mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Import and export themes in a .tar.gz format (#6916)
This commit is contained in:
@@ -14,6 +14,8 @@ class ThemeStore::TgzImporter
|
||||
Dir.chdir(@temp_folder) do
|
||||
Discourse::Utils.execute_command("tar", "-xzvf", @filename, "--strip", "1")
|
||||
end
|
||||
rescue RuntimeError
|
||||
raise RemoteTheme::ImportError, I18n.t("themes.import_error.unpack_failed")
|
||||
end
|
||||
|
||||
def cleanup!
|
||||
@@ -38,6 +40,12 @@ class ThemeStore::TgzImporter
|
||||
end
|
||||
end
|
||||
|
||||
def all_files
|
||||
Dir.chdir(@temp_folder) do
|
||||
Dir.glob("**/*").reject { |f| File.directory?(f) }
|
||||
end
|
||||
end
|
||||
|
||||
def [](value)
|
||||
fullpath = real_path(value)
|
||||
return nil unless fullpath
|
||||
|
||||
Reference in New Issue
Block a user