Permalink
Browse files

Handle working from a non-existent path (#675398)

  • Loading branch information...
1 parent 9934b23 commit 141375120c59e056ac93b5b026f7dbd3bdbec0a6 @jkeating jkeating committed Feb 8, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/fedpkg.py
View
@@ -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 @@ def parse_cmdline(generate_manpage = False):
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.

0 comments on commit 1413751

Please sign in to comment.