Skip to content

Commit 27585a5

Browse files
committed
fix: always use absolute path to temp folders
1 parent b88a856 commit 27585a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

package.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,12 @@ def tempdir(dir=None):
124124
"""Creates a temporary directory and then deletes it afterwards."""
125125
prefix = "terraform-aws-lambda-"
126126
path = tempfile.mkdtemp(prefix=prefix, dir=dir)
127-
cmd_log.info("mktemp -d %sXXXXXXXX # %s", prefix, shlex.quote(path))
127+
abs_path = os.path.abspath(path)
128+
cmd_log.info("mktemp -d %sXXXXXXXX # %s", prefix, shlex.quote(abs_path))
128129
try:
129-
yield path
130+
yield abs_path
130131
finally:
131-
shutil.rmtree(path)
132+
shutil.rmtree(abs_path)
132133

133134

134135
def list_files(top_path, log=None):

0 commit comments

Comments
 (0)