mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/file-setup.git
synced 2024-12-26 19:34:19 +00:00
Fix zip creation
This commit is contained in:
parent
fa3b3cc556
commit
2952a274e4
@ -37,11 +37,15 @@ def merge_images(input_dir, output_dir, output_file_base, zip):
|
|||||||
cmd = 'rm "{}"/file_list.txt'.format(input_dir)
|
cmd = 'rm "{}"/file_list.txt'.format(input_dir)
|
||||||
subprocess.run(cmd, shell=True)
|
subprocess.run(cmd, shell=True)
|
||||||
if zip is not None:
|
if zip is not None:
|
||||||
|
# Remove .zip file extension if provided
|
||||||
|
if zip.endswith('.zip'):
|
||||||
|
zip = zip[:-4]
|
||||||
|
zip = zip if zip else 'output'
|
||||||
cmd = 'cd "{}"'.format(output_dir)
|
cmd = 'cd "{}"'.format(output_dir)
|
||||||
cmd += ' && '
|
cmd += ' && '
|
||||||
cmd += 'zip'
|
cmd += 'zip'
|
||||||
cmd += ' -m'
|
cmd += ' -m'
|
||||||
cmd += ' "{}"_-_pdf "{}".pdf'.format(zip, output_file_base)
|
cmd += ' "{}" "{}".pdf'.format(zip, output_file_base)
|
||||||
cmd += ' && '
|
cmd += ' && '
|
||||||
cmd += 'cd -'
|
cmd += 'cd -'
|
||||||
subprocess.run(cmd, shell=True)
|
subprocess.run(cmd, shell=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user