Skip to content

Commit

Permalink
Merge pull request #29 from InitHello/master
Browse files Browse the repository at this point in the history
Resolve symlinks when creating a tarball (addresses #28)
  • Loading branch information
martenson committed Dec 1, 2014
2 parents 44de95c + 3da16d7 commit 5c924ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion planemo/shed.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def build_tarball(tool_path):
try:
with tarfile.open(temp_path, "w:gz") as tar:
for name in os.listdir(tool_path):
path = os.path.join(tool_path, name)
if os.path.islink(name):
path = os.path.realpath(name)
else:
path = os.path.join(tool_path, name)
tar.add(path, name, recursive=True, exclude=_tar_excludes)
finally:
os.close(fd)
Expand Down

0 comments on commit 5c924ec

Please sign in to comment.