diff options
author | Phillip Smyth <phillipsmyth@codethink.co.uk> | 2018-01-12 12:30:02 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-02-13 06:07:43 +0100 |
commit | b5f43ece275638b5ba4bff817ba3379dd9ae936a (patch) | |
tree | 88860f20ab84d353083f6504823cc6fa5cb92b0e | |
parent | b6e0dd362bdd309ed74474e4a3dce9f2e3763015 (diff) | |
download | buildstream-b5f43ece275638b5ba4bff817ba3379dd9ae936a.tar.gz |
_frontend/cli.py: Improve closing of non-existing workspace
Fixes #182
-rw-r--r-- | buildstream/_frontend/cli.py | 5 |
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) |