FIX: Accept github theme urls with a trailing slash

This commit is contained in:
David Taylor
2019-06-04 10:28:36 +01:00
parent 9585a16264
commit 0508546fd2
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,7 @@ class ThemeStore::GitImporter
def initialize(url, private_key: nil, branch: nil)
@url = url
if @url.start_with?("https://github.com") && !@url.end_with?(".git")
@url = @url.gsub(/\/$/, '')
@url += ".git"
end
@temp_folder = "#{Pathname.new(Dir.tmpdir).realpath}/discourse_theme_#{SecureRandom.hex}"