pmbootstrap: Check if work folder exists before doing anything (#966)
Fixes #949.
This commit is contained in:
parent
aa45e1be12
commit
77a90b9e01
|
@ -44,9 +44,11 @@ def main():
|
||||||
if args.action == "init":
|
if args.action == "init":
|
||||||
return config_init.frontend(args)
|
return config_init.frontend(args)
|
||||||
elif not os.path.exists(args.config):
|
elif not os.path.exists(args.config):
|
||||||
logging.critical("Please specify a config file, or run"
|
raise RuntimeError("Please specify a config file, or run"
|
||||||
" 'pmbootstrap init' to generate one.")
|
" 'pmbootstrap init' to generate one.")
|
||||||
return 1
|
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
|
# Migrate work folder if necessary
|
||||||
if args.action not in ["shutdown", "zap", "log"]:
|
if args.action not in ["shutdown", "zap", "log"]:
|
||||||
|
|
Loading…
Reference in New Issue