diff --git a/bench/cli.py b/bench/cli.py index 4df81ec6..410b3057 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -109,8 +109,15 @@ def cli(): logger.warning(f"{command} executed with exit code {return_code}") if isinstance(e, Exception): - if os.environ.get("BENCH_DEVELOPER") or bench_config.get("developer_mode"): - click.secho("".join(format_exception(*sys.exc_info()))[:-1]) + if ( + os.environ.get("BENCH_DEVELOPER") + or bench_config.get("developer_mode") + or ( + sys.argv[1] in ("init", "get", "get-app") and not in_bench + ) + ): + from bench.utils import get_traceback + click.echo(get_traceback()) click.secho(f"ERROR: {e}", fg="red") return_code = 1 raise e diff --git a/bench/commands/make.py b/bench/commands/make.py index 458ca606..cba4a2cf 100755 --- a/bench/commands/make.py +++ b/bench/commands/make.py @@ -50,7 +50,7 @@ def init(path, apps_path, frappe_path, frappe_branch, no_procfile, no_backups, c time.sleep(1) print(get_traceback()) log(f"There was a problem while creating {path}", level=2) - if click.confirm("Do you want to rollback these changes?"): + if click.confirm("Do you want to rollback these changes?", abort=True): print(f'Rolling back Bench "{path}"') if os.path.exists(path): shutil.rmtree(path)