DEV: Do not add -theme suffix to theme exports

This could be confusing if the theme name already ended in "theme" or "theme-component"
This commit is contained in:
David Taylor 2019-01-31 17:46:39 +00:00
parent 43f3bf71ba
commit c0b1a1a914

View File

@ -5,7 +5,7 @@ class ThemeStore::TgzExporter
def initialize(theme) def initialize(theme)
@theme = theme @theme = theme
@temp_folder = "#{Pathname.new(Dir.tmpdir).realpath}/discourse_theme_#{SecureRandom.hex}" @temp_folder = "#{Pathname.new(Dir.tmpdir).realpath}/discourse_theme_#{SecureRandom.hex}"
@export_name = "#{@theme.name.downcase.gsub(/[^0-9a-z.\-]/, '-')}-theme" @export_name = @theme.name.downcase.gsub(/[^0-9a-z.\-]/, '-')
@export_name = "discourse-#{@export_name}" unless @export_name.starts_with?("discourse") @export_name = "discourse-#{@export_name}" unless @export_name.starts_with?("discourse")
end end