From 141375120c59e056ac93b5b026f7dbd3bdbec0a6 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 8 Feb 2011 16:44:14 -0700 Subject: Handle working from a non-existent path (#675398) --- src/fedpkg.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/fedpkg.py') diff --git a/src/fedpkg.py b/src/fedpkg.py index 522718c..ee1a0ec 100755 --- a/src/fedpkg.py +++ b/src/fedpkg.py @@ -869,7 +869,7 @@ def parse_cmdline(generate_manpage = False): parser.add_argument('-u', '--user', help = "Override the username found in the fedora cert") # Let the user define which path to look at instead of pwd - parser.add_argument('--path', default = os.getcwd(), + parser.add_argument('--path', default = None, help='Directory to interact with instead of current dir') # Verbosity parser.add_argument('-v', action = 'store_true', @@ -1254,6 +1254,13 @@ packages will be built sequentially. if __name__ == '__main__': args = parse_cmdline() + if not args.path: + try: + args.path=os.getcwd() + except: + print('Could not get current path, have you deleted it?') + sys.exit(1) + # setup the logger -- This logger will take things of INFO or DEBUG and # log it to stdout. Anything above that (WARN, ERROR, CRITICAL) will go # to stderr. Normal operation will show anything INFO and above. -- cgit