summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRebecca Grayson <becky.grayson1@hotmail.co.uk>2019-07-15 13:23:11 +0100
committerRebecca Grayson <becky.grayson1@hotmail.co.uk>2019-07-16 12:11:07 +0100
commitce12bbf1bb4bc1d0ede83d1591a499d59fd4c875 (patch)
treed796e332c29cf94a26cc2ef4fe22e70d573807c5 /src
parent6163ef87e0ab871efe44630aac00487fcfa06c65 (diff)
downloadbuildstream-ce12bbf1bb4bc1d0ede83d1591a499d59fd4c875.tar.gz
Checkout to default dir if no tar or directory:
When neither --tar nor --directory are provided, bst artifact checkout will no longer error out. Defaults to a suitable directory, consistent with bst workspace open. Test for new feature has been added
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_frontend/cli.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 1f5d500a8..8fd834825 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -991,10 +991,6 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, pull_, direct
click.echo("ERROR: options --hardlinks and --tar conflict", err=True)
sys.exit(-1)
- if tar is None and directory is None:
- click.echo("ERROR: One of --directory or --tar must be provided", err=True)
- sys.exit(-1)
-
if tar is not None and directory is not None:
click.echo("ERROR: options --directory and --tar conflict", err=True)
sys.exit(-1)
@@ -1003,7 +999,12 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, pull_, direct
location = tar
tar = True
else:
- location = os.getcwd() if directory is None else directory
+ if directory is None:
+ location = os.path.abspath(os.path.join(os.getcwd(), element))
+ else:
+ location = directory
+ if location[-4:] == '.bst':
+ location = location[:-4]
tar = False
if deps == "build":