From 89f3ae26497c6b94231aba5aebba545f53975c1a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 May 2015 22:55:26 +1000 Subject: [PATCH] bam pack: Support for passing the dir only if you give a dir as output, it will use the input path name. (changing blend to zip if needed) --- bam/cli.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bam/cli.py b/bam/cli.py index be8677e..e96d61b 100755 --- a/bam/cli.py +++ b/bam/cli.py @@ -1332,6 +1332,12 @@ class bam_commands: if output is None: fatal("Output path must be given when packing with: --mode=FILE") + if os.path.isdir(output): + if mode == "ZIP": + output = os.path.join(output, os.path.splitext(path)[0] + ".zip") + else: # FILE + output = os.path.join(output, os.path.basename(path)) + if use_quiet: report = lambda msg: None else: