FIX: Only delete theme folder if it has been created

If an exception is raised before the folder is created, then this `ensure` block is still run
This commit is contained in:
David Taylor 2019-05-17 09:45:11 +01:00
parent 148bfc9be5
commit 105359e54a
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class ThemeStore::GitImporter
return Discourse::Utils.execute_command("git", "diff", "--staged")
end
ensure
FileUtils.rm_rf local_temp_folder
FileUtils.rm_rf local_temp_folder if local_temp_folder
end
def commits_since(hash)