summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/_frontend/cli.py')
-rw-r--r--buildstream/_frontend/cli.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 512966b8b..8678e8228 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -618,6 +618,11 @@ def workspace_close(app, remove_dir, element):
"""Close a workspace"""
app.initialize((element,))
+
+ if app.pipeline.project._get_workspace(app.pipeline.targets[0].name) is None:
+ click.echo("ERROR: Workspace '{}' does not exist".format(element), 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)