Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Check for bash in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tletnes committed Jul 22, 2022
1 parent 35c0458 commit 034bb91
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
###############################################################################
# Build cpu dependencies.

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

# Do not set Exit on Error in scripts that will be sourced
# set -o errexit

Expand Down
6 changes: 6 additions & 0 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
###############################################################################
# Build cpu.

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

if [ "$0" = "$BASH_SOURCE" ]
then
set -o errexit
Expand Down
6 changes: 6 additions & 0 deletions script/clean
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
###############################################################################
# Clean cpu.

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

if [ "$0" = "$BASH_SOURCE" ]
then
set -o errexit
Expand Down
6 changes: 6 additions & 0 deletions script/install
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
###############################################################################
# Install cpu.

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

if [ "$0" = "$BASH_SOURCE" ]
then
set -o errexit
Expand Down
6 changes: 6 additions & 0 deletions script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
###############################################################################
# Check code for issues.

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

if [ "$0" = "$BASH_SOURCE" ]
then
set -o errexit
Expand Down
6 changes: 6 additions & 0 deletions script/stress
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
# (if there's failure, test's failed)
###############################################################################

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

## start of boilerplate to switch to project root ------------------------------
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
proj_dir="$( dirname "${script_dir}" )"
Expand Down
6 changes: 6 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
###############################################################################
# Run basic tests on base.

if [ -z "$BASH_VERSION" ]
then
echo "This script must be run under bash"
exit 1
fi

if [ "$0" = "$BASH_SOURCE" ]
then
set -o errexit
Expand Down

0 comments on commit 034bb91

Please sign in to comment.