fixed 文件增加是否文本判断,可显示多种文本文件

This commit is contained in:
2023-10-10 14:17:08 +08:00
parent 0357f963ff
commit 5a28204b12
2 changed files with 8 additions and 1 deletions

View File

@@ -2,7 +2,8 @@ if @project.forge?
is_dir = @sub_entries.is_a?(Array)
file_name = entry['name']
file_type = file_name.starts_with?('.') ? file_name[1..-1] : File.extname(file_name.to_s)[1..-1]
direct_download = %w(makefile dockerfile readme).exclude?(file_name.to_s.downcase) && download_type(file_type)
# direct_download = %w(makefile dockerfile readme).exclude?(file_name.to_s.downcase) && download_type(file_type)
direct_download = entry['is_text_file'] == true ? false : true
image_type = image_type?(file_type)
json.name file_name
json.sha entry['sha']