From c9ace31061bd297a7cc9c8a237078f55e970d892 Mon Sep 17 00:00:00 2001 From: "Ira W. Snyder" Date: Tue, 26 Dec 2006 20:00:52 -0800 Subject: [PATCH] [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 --- rarslave.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.25.1