Skip to content

Commit c3999d2

Browse files
allow for copying symlinks when copying tree to create zip
1 parent 5150fe7 commit c3999d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lambda_uploader/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ def copy_tree(src, dest, ignore=None, include_parent=False):
5151
os.makedirs(pkg_path)
5252

5353
LOG.debug("Copying %s to %s" % (path, pkg_path))
54-
shutil.copy(path, pkg_path)
54+
if os.path.islink(path):
55+
linkto = os.readlink(path)
56+
os.symlink(linkto, os.path.join(pkg_path, filename))
57+
else:
58+
shutil.copy(path, pkg_path)
5559

5660

5761
# Iterate through every item in ignore

0 commit comments

Comments
 (0)