aboutsummaryrefslogtreecommitdiff
path: root/etc/environments/default
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-07-06 11:59:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-07-06 12:19:09 +0200
commit2359cd2a404e3dfed40d5c714b9c58acfbbaddc3 (patch)
tree00bf83768e9048fb495a6c930cbbf34366ed120d /etc/environments/default
parent52c0f8e9669e5d80cefa62237202d5c911a2df32 (diff)
Run interactive shell from environment script if no bbot specified
Diffstat (limited to 'etc/environments/default')
-rwxr-xr-xetc/environments/default10
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/environments/default b/etc/environments/default
index 25646e6..c7c7953 100755
--- a/etc/environments/default
+++ b/etc/environments/default
@@ -13,7 +13,7 @@ c=gcc
cxx=g++
# $1 - target
-# $2 - bbot executable
+# $2 - bbot executable (if absent, then run $SHELL)
# $3+ - bbot options
set -e # Exit on errors.
@@ -35,4 +35,10 @@ case "$1" in
esac
shift
-exec "$@" cc config.c="$c $mode" config.cxx="$cxx $mode"
+if test $# -ne 0; then
+ exec "$@" cc config.c="$c $mode" config.cxx="$cxx $mode"
+else
+ echo "config.c=$c $mode" 1>&2
+ echo "config.cxx=$cxx $mode" 1>&2
+ exec $SHELL -i
+fi