Add a check to make sure the working directory is valid before trying
anything, that way we don't fail later.
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
sys.exit(1)
def run_options (options):
+
+ # Fix directories
options.work_dir = full_abspath (options.work_dir)
+ # Make sure that the directory is valid
+ if not os.path.isdir (options.work_dir):
+ sys.stderr.write ('\"%s\" is not a valid directory. Use the \"-d\"\n' % options.work_dir)
+ sys.stderr.write ('option to override the working directory temporarily, or edit the\n')
+ sys.stderr.write ('configuration file to override the working directory permanently.\n')
+ sys.exit (1)
+
if options.extract_dir != None:
options.extract_dir = full_abspath (options.extract_dir)