fix: get file extname
This commit is contained in:
parent
f5e07ab3ec
commit
f334864f1b
|
@ -81,7 +81,7 @@ module RepositoriesHelper
|
|||
content = Gitea::Repository::Entries::GetService.call(owner, repo.identifier, entry['path'], ref: ref)['content']
|
||||
readme_render_decode64_content(content, path)
|
||||
else
|
||||
file_type = entry['name'].to_s.split(".").last
|
||||
file_type = File.extname(entry['name'].to_s)[1..-1]
|
||||
if download_type(file_type)
|
||||
return entry['content'].nil? ? Gitea::Repository::Entries::GetService.call(owner, repo.identifier, entry['path'], ref: ref)['content'] : entry['content']
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if @project.forge?
|
||||
file_name = entry['name']
|
||||
file_type = file_name.to_s.split(".").last
|
||||
file_type = File.extname(file_name.to_s)[1..-1]
|
||||
direct_download = download_type(file_type)
|
||||
image_type = image_type?(file_type)
|
||||
json.name file_name
|
||||
|
|
Loading…
Reference in New Issue