diff options
author | Jesse Keating <jkeating@redhat.com> | 2011-02-08 16:44:14 -0700 |
---|---|---|
committer | Jesse Keating <jkeating@redhat.com> | 2011-02-08 16:44:14 -0700 |
commit | 141375120c59e056ac93b5b026f7dbd3bdbec0a6 (patch) | |
tree | 61112b3bd6374b9bdf14316ddf6b3752ae4345f2 /src/fedpkg.py | |
parent | 9934b23746043b66842ead8e998abcef6d27496a (diff) | |
download | fedora-packager-141375120c59e056ac93b5b026f7dbd3bdbec0a6.tar.gz fedora-packager-141375120c59e056ac93b5b026f7dbd3bdbec0a6.tar.xz fedora-packager-141375120c59e056ac93b5b026f7dbd3bdbec0a6.zip |
Handle working from a non-existent path (#675398)
Diffstat (limited to 'src/fedpkg.py')
-rwxr-xr-x | src/fedpkg.py | 9 |
1 files changed, 8 insertions, 1 deletions
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. |