Skip to content

Commit

Permalink
Merge branch 'master' of github.com:caltechlibrary/eprints2bags
Browse files Browse the repository at this point in the history
  • Loading branch information
mhucka committed Nov 2, 2019
2 parents a5cd026 + 93138da commit b4ab6d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eprints2bags/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def create_archive(archive_file, type, source_dir, comment = None):
format = ZIP_STORED if type.startswith('uncompress') else ZIP_DEFLATED
current_dir = os.getcwd()
try:
os.chdir(root_dir)
if root_dir != '':
os.chdir(root_dir)
with zipfile.ZipFile(archive_file, 'w', format) as zf:
for root, dirs, files in os.walk(base_dir):
for file in files:
Expand Down

0 comments on commit b4ab6d3

Please sign in to comment.