From 774210206ef52a7f5b0d2e209389ada69904a928 Mon Sep 17 00:00:00 2001 From: yystopf Date: Wed, 15 Feb 2023 11:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=BB=A5.=E5=BC=80=E5=A4=B4=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/_simple_entry.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/repositories/_simple_entry.json.jbuilder b/app/views/repositories/_simple_entry.json.jbuilder index 0b2a60b57..bbbd09d54 100644 --- a/app/views/repositories/_simple_entry.json.jbuilder +++ b/app/views/repositories/_simple_entry.json.jbuilder @@ -1,6 +1,6 @@ if @project.forge? file_name = entry['name'] - file_type = File.extname(file_name.to_s)[1..-1] + file_type = file_name.starts_with?('.') ? file_name[1..-1] : File.extname(file_name.to_s)[1..-1] direct_download = file_name.to_s.downcase != "Makefile".downcase && download_type(file_type) image_type = image_type?(file_type) json.name file_name