Skip to content

Commit 4cf3da4

Browse files
authored
Merge pull request #948 from twz123/posix-sh
build: Use POSIX sh for shell scripts
2 parents c20da15 + 853b82d commit 4cf3da4

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)