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

Commit 034bb91

Browse files
author
Thad Letnes
committed
Check for bash in scripts
1 parent 35c0458 commit 034bb91

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed

script/bootstrap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
###############################################################################
77
# Build cpu dependencies.
88

9+
if [ -z "$BASH_VERSION" ]
10+
then
11+
echo "This script must be run under bash"
12+
exit 1
13+
fi
14+
915
# Do not set Exit on Error in scripts that will be sourced
1016
# set -o errexit
1117

script/build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
###############################################################################
77
# Build cpu.
88

9+
if [ -z "$BASH_VERSION" ]
10+
then
11+
echo "This script must be run under bash"
12+
exit 1
13+
fi
14+
915
if [ "$0" = "$BASH_SOURCE" ]
1016
then
1117
set -o errexit

script/clean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
###############################################################################
77
# Clean cpu.
88

9+
if [ -z "$BASH_VERSION" ]
10+
then
11+
echo "This script must be run under bash"
12+
exit 1
13+
fi
14+
915
if [ "$0" = "$BASH_SOURCE" ]
1016
then
1117
set -o errexit

script/install

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
###############################################################################
77
# Install cpu.
88

9+
if [ -z "$BASH_VERSION" ]
10+
then
11+
echo "This script must be run under bash"
12+
exit 1
13+
fi
14+
915
if [ "$0" = "$BASH_SOURCE" ]
1016
then
1117
set -o errexit

script/lint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
###############################################################################
77
# Check code for issues.
88

9+
if [ -z "$BASH_VERSION" ]
10+
then
11+
echo "This script must be run under bash"
12+
exit 1
13+
fi
14+
915
if [ "$0" = "$BASH_SOURCE" ]
1016
then
1117
set -o errexit

script/stress

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
# (if there's failure, test's failed)
1919
###############################################################################
2020

21+
if [ -z "$BASH_VERSION" ]
22+
then
23+
echo "This script must be run under bash"
24+
exit 1
25+
fi
26+
2127
## start of boilerplate to switch to project root ------------------------------
2228
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
2329
proj_dir="$( dirname "${script_dir}" )"

script/test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
###############################################################################
77
# Run basic tests on base.
88

9+
if [ -z "$BASH_VERSION" ]
10+
then
11+
echo "This script must be run under bash"
12+
exit 1
13+
fi
14+
915
if [ "$0" = "$BASH_SOURCE" ]
1016
then
1117
set -o errexit

0 commit comments

Comments
 (0)