summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-17 16:02:09 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-17 16:02:09 +0900
commit9cf8d35fce45b85de3535815501af92e175faa3b (patch)
treedaff3cda6790e6343174168fe2b2a16c2db68a4c
parent86587bf92d0ab986eb1a5a099953f7658da38292 (diff)
downloadbuildstream-9cf8d35fce45b85de3535815501af92e175faa3b.tar.gz
_frontend: Fix error messaging for closing workspaces
This fixes issue #182 again
-rw-r--r--buildstream/_frontend/app.py5
-rw-r--r--buildstream/_frontend/cli.py5
2 files changed, 5 insertions, 5 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index 653a87009..767e0cf1b 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -498,6 +498,11 @@ class App():
if workspace is None:
raise AppError("Workspace '{}' does not exist".format(element_name))
+ if self.interactive and remove_dir:
+ if not click.confirm('This will remove all your changes, are you sure?'):
+ click.echo('Aborting', err=True)
+ sys.exit(-1)
+
# Remove workspace directory if prompted
if remove_dir:
with self.context.timed_activity("Removing workspace directory {}"
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 2490f59b7..fadfaf59b 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -635,11 +635,6 @@ def workspace_close(app, remove_dir, all_, elements):
click.echo('ERROR: no elements specified', err=True)
sys.exit(-1)
- if app.interactive and remove_dir:
- if not click.confirm('This will remove all your changes, are you sure?'):
- click.echo('Aborting', err=True)
- sys.exit(-1)
-
with app.partially_initialized():
if all_:
elements = [element_name for element_name, _ in app.project.workspaces.list()]