From 57f5accd78d2819bc7c26d8248419aafb0d13855 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Sun, 8 Feb 2015 21:17:24 -0500 Subject: [bugfix]: combox/config.py - when empty string is given for 'silo_dir'; it sets the dir to PWD, this was not intended. This was fixed. When empty string is given for 'silo_dir', the intended default directory was the combox's config directory. The input to 'silo_dir' was directly given to path.abspath() The path.abspath() function, when an empty string is given returns the PWD. That's where the bug was! So, now the 'silo_dir' input is read to a local variable `silo_dir'. If the local variable `silo_dir' is empty, the combox config directory is assigned; else, the given directory is assigned. --- combox/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/combox/config.py b/combox/config.py index 290bc3c..c4b83c4 100644 --- a/combox/config.py +++ b/combox/config.py @@ -79,9 +79,11 @@ def config_cb(config_dir = path.join(os.getenv('HOME'),'.combox/'), config_info['combox_dir'] = path.abspath(input_func('path to combox directory')) silo_help_txt = 'silo directory (default: %s)' % (config_dir) - config_info['silo_dir'] = path.abspath(input_func(silo_help_txt)) + silo_dir = input_func(silo_help_txt) - if not config_info['silo_dir']: + if silo_dir: + config_info['silo_dir'] = path.abspath(silo_dir) + else: config_info['silo_dir'] = config_dir config_info['topsecret'] = pass_func() -- cgit v1.2.3