Skip to content

Commit 853b82d

Browse files
committed
build: Use POSIX sh for shell scripts
The scripts didn't really use any bash specific features. Convert them to POSIX shell scripts, so that the plugins can be built without requiring bash. Signed-off-by: Tom Wieczorek <[email protected]>
1 parent f955052 commit 853b82d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
set -e
33
cd "$(dirname "$0")"
44

5-
if [ "$(uname)" == "Darwin" ]; then
5+
if [ "$(uname)" = "Darwin" ]; then
66
export GOOS="${GOOS:-linux}"
77
fi
88

build_windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
set -e
33
cd "$(dirname "$0")"
44

scripts/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
set -xe
33

44
SRC_DIR="${SRC_DIR:-$PWD}"

test_linux.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
#
33
# Run CNI plugin tests.
44
#
@@ -10,12 +10,12 @@ set -e
1010
cd "$(dirname "$0")"
1111

1212
# Build all plugins before testing
13-
source ./build_linux.sh
13+
. ./build_linux.sh
1414

1515
echo "Running tests"
1616

17-
function testrun {
18-
sudo -E bash -c "umask 0; PATH=${GOPATH}/bin:$(pwd)/bin:${PATH} go test -race $@"
17+
testrun() {
18+
sudo -E sh -c "umask 0; PATH=${GOPATH}/bin:$(pwd)/bin:${PATH} go test -race $*"
1919
}
2020

2121
COVERALLS=${COVERALLS:-""}

test_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
#
33
# Run CNI plugin tests.
44
#
55
set -e
66
cd "$(dirname "$0")"
77

8-
source ./build_windows.sh
8+
. ./build_windows.sh
99

1010
echo "Running tests"
1111

0 commit comments

Comments
 (0)