From: Ira W. Snyder Date: Wed, 27 Dec 2006 04:00:52 +0000 (-0800) Subject: [RARSLAVE] Fix working directory option X-Git-Tag: v2.0.0~42 X-Git-Url: https://www.irasnyder.com/gitweb/?p=rarslave2.git;a=commitdiff_plain;h=c9ace31061bd297a7cc9c8a237078f55e970d892 [RARSLAVE] Fix working directory option 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 --- diff --git a/rarslave.py b/rarslave.py index 1315f85..ceb7eac 100644 --- a/rarslave.py +++ b/rarslave.py @@ -479,8 +479,17 @@ def check_required_progs(): 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)