pmbootstrap: Check if work folder exists before doing anything (#966)

Fixes #949.
This commit is contained in:
Oliver Smith 2017-12-02 16:40:55 +00:00 committed by GitHub
parent aa45e1be12
commit 77a90b9e01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -44,9 +44,11 @@ def main():
if args.action == "init":
return config_init.frontend(args)
elif not os.path.exists(args.config):
logging.critical("Please specify a config file, or run"
" 'pmbootstrap init' to generate one.")
return 1
raise RuntimeError("Please specify a config file, or run"
" 'pmbootstrap init' to generate one.")
elif not os.path.exists(args.work):
raise RuntimeError("Work path not found, please run 'pmbootstrap"
" init' to create it.")
# Migrate work folder if necessary
if args.action not in ["shutdown", "zap", "log"]: