From 24c7320575ff58e0e7c34f44eb9569f951ffecd4 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Mon, 9 Sep 2019 14:31:40 +0300 Subject: [PATCH] dbuild: run interactive shell by default If not given any other args to run, just run an interactive shell. Signed-off-by: Benny Halevy Message-Id: <20190909113140.9130-1-bhalevy@scylladb.com> --- tools/toolchain/dbuild | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/toolchain/dbuild b/tools/toolchain/dbuild index 24a8f05bef..fc8847c3ba 100755 --- a/tools/toolchain/dbuild +++ b/tools/toolchain/dbuild @@ -11,7 +11,10 @@ done interactive= -if [[ "$1" = -* ]]; then +if [[ $# -eq 0 ]]; then + interactive=y + docker_args=(-it) +elif [[ "$1" = -* ]]; then while [[ "$1" != "--" && $# != 0 ]]; do case "$1" in --*) @@ -37,6 +40,12 @@ if [[ "$1" = -* ]]; then shift fi +if [[ $# != 0 ]]; then + args=("$@") +else + args=(/bin/bash -i) +fi + MAVEN_LOCAL_REPO="$HOME/.m2" mkdir -p "$MAVEN_LOCAL_REPO" @@ -56,7 +65,7 @@ docker_common_args=( -w "$PWD" \ "${docker_args[@]}" \ "$(<"$here/image")" \ - "$@" + "${args[@]}" ) if [[ -n "$interactive" ]]; then