summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-18 11:59:39 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-18 11:48:53 +0000
commitc1c2040226202ef3a9092005e38ae79dce27a3ee (patch)
tree53668e0b698823f4e153e2938a940f8e8eb8631f /contrib
parent0d3ce052166f9233587ef7e790253fbc24b0861c (diff)
downloadbuildstream-c1c2040226202ef3a9092005e38ae79dce27a3ee.tar.gz
contrib/bst-here: Change how invocation works
If run with no arguments, `bst-here` now opens an interactive Bash shell. This has several advantages to running each `bst` command in a new container: * it's faster * bash completions will work * man pages could work (if the user runs `dnf install man`) If run with arguments, those are now assumed to be arguments for `bst` such that instead of running `bst-here bst build foo` you now just run `bst-here build foo`.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/bst-here8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/bst-here b/contrib/bst-here
index 595807df4..6b4e6b2f7 100755
--- a/contrib/bst-here
+++ b/contrib/bst-here
@@ -58,6 +58,12 @@ done
BST_HERE_PS1="\[\033[01;34m\]\w\[\033[00m\]> "
+if [ "$#" -eq 0 ]; then
+ command="/bin/bash -i"
+else
+ command="/usr/bin/bst $@"
+fi
+
exec docker run --rm -i${is_tty:+ -t} \
--cap-add SYS_ADMIN \
--env PS1="$BST_HERE_PS1" \
@@ -68,4 +74,4 @@ exec docker run --rm -i${is_tty:+ -t} \
--volume "$PWD":/src \
--workdir /src \
buildstream/buildstream-fedora:latest \
- "$@"
+ $command