-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script should not end terminal if not using bash (#5630)
* Script should not end terminal if not using bash If the user hit the exit 0 (when using source) and they did not use bash terminal would exit. The user would not know why the terminal exited. Updated script to just check to see if there is bash available. Set namespace to default if not specified Add additional instructions when not running in bash Document the use of the --namespace key namespace is no longer positional but requires a --namespace or -ns key * Update set-ver.sh Make scdf the default namespace [skip ci] --------- Co-authored-by: Corneil du Plessis <[email protected]>
- Loading branch information
Showing
3 changed files
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
#!/usr/bin/env bash | ||
(return 0 2>/dev/null) && sourced=1 || sourced=0 | ||
if [ "$sourced" = "0" ]; then | ||
echo "This script must be invoked using: source $0 $*" | ||
exit 1 | ||
fi | ||
if [ -z "$BASH_VERSION" ]; then | ||
echo "This script requires Bash. Use: bash $0 $*" | ||
exit 0 | ||
echo "This script requires Bash. For example:\n bash \n $0 $*" | ||
else | ||
echo "Setting variables" | ||
SCDIR=$(readlink -f "${BASH_SOURCE[0]}") | ||
SCDIR=$(dirname "$SCDIR") | ||
SCDIR=$(realpath $SCDIR) | ||
source $SCDIR/use-mk.sh docker $* | ||
fi | ||
SCDIR=$(readlink -f "${BASH_SOURCE[0]}") | ||
SCDIR=$(dirname "$SCDIR") | ||
SCDIR=$(realpath $SCDIR) | ||
source $SCDIR/use-mk.sh docker $* |