summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2011-02-08 16:44:14 -0700
committerJesse Keating <jkeating@redhat.com>2011-02-08 16:44:14 -0700
commit141375120c59e056ac93b5b026f7dbd3bdbec0a6 (patch)
tree61112b3bd6374b9bdf14316ddf6b3752ae4345f2
parent9934b23746043b66842ead8e998abcef6d27496a (diff)
downloadfedora-packager-141375120c59e056ac93b5b026f7dbd3bdbec0a6.zip
fedora-packager-141375120c59e056ac93b5b026f7dbd3bdbec0a6.tar.gz
fedora-packager-141375120c59e056ac93b5b026f7dbd3bdbec0a6.tar.xz
Handle working from a non-existent path (#675398)
-rwxr-xr-xsrc/fedpkg.py9
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.