diff --git a/lib/terraspace/compiler/erb/rewrite.rb b/lib/terraspace/compiler/erb/rewrite.rb index dfe59415..34c88870 100644 --- a/lib/terraspace/compiler/erb/rewrite.rb +++ b/lib/terraspace/compiler/erb/rewrite.rb @@ -8,7 +8,7 @@ def rewrite input = IO.read(@src_path) output = replace(input) tfvar_path = @src_path.sub(Terraspace.root,'') - temp_path = "/tmp/terraspace/rewrite#{tfvar_path}" + temp_path = "#{Terraspace.tmp_root}/rewrite#{tfvar_path}" FileUtils.mkdir_p(File.dirname(temp_path)) IO.write(temp_path, output) temp_path diff --git a/lib/terraspace/terraform/api/vars/json.rb b/lib/terraspace/terraform/api/vars/json.rb index 79d56cf4..ef268f8f 100644 --- a/lib/terraspace/terraform/api/vars/json.rb +++ b/lib/terraspace/terraform/api/vars/json.rb @@ -16,7 +16,7 @@ def json_load(result) rescue JSON::ParserError => e # TODO: show exact line with error logger.info("ERROR in json: #{e.class}: #{e.message}") - path = "/tmp/terraspace/debug/vars.json" + path = "#{Terraspace.tmp_root}/terraspace/debug/vars.json" logger.info("Result also written to #{path} for inspection") FileUtils.mkdir_p(File.dirname(path)) IO.write(path, result)