Skip to content

Commit 777b315

Browse files
committed
pushd and popd are not supported on travis.
This replaces them with a simple subshell.
1 parent 9f230d7 commit 777b315

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test.sh

+10-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ FULL_SCRIPT_PATH="$PWD/index.js"
1818
EXPECTED_VERSION_STRING=" at $PWD/testproject/node_modules/" # somewhere in there
1919
EXPECTED_GLOB_STRING="ran clang-format on 1 file" # somewhere in there
2020

21-
pushd $PWD/testproject
22-
npm install &>/dev/null # Should give us a local clang-format, version doesn't really matter.
23-
VERSION=`/usr/bin/env node $FULL_SCRIPT_PATH -version`
24-
if [[ $VERSION != *"$EXPECTED_VERSION_STRING"* ]]; then
25-
echo "[FAIL] Expected string containing $EXPECTED_VERSION_STRING, got $VERSION" >&2
26-
exit 1
27-
fi
28-
echo "[PASS] no file argument uses working directory" >&2
29-
popd
21+
(
22+
cd $PWD/testproject
23+
npm install &>/dev/null # Should give us a local clang-format, version doesn't really matter.
24+
VERSION=`/usr/bin/env node $FULL_SCRIPT_PATH -version`
25+
if [[ $VERSION != *"$EXPECTED_VERSION_STRING"* ]]; then
26+
echo "[FAIL] Expected string containing $EXPECTED_VERSION_STRING, got $VERSION" >&2
27+
exit 1
28+
fi
29+
echo "[PASS] no file argument uses working directory" >&2
30+
)
3031

3132
VERSION=`/usr/bin/env node $FULL_SCRIPT_PATH -version $PWD/testproject/lib/test.js`
3233
if [[ $VERSION != *"$EXPECTED_VERSION_STRING"* ]]; then

0 commit comments

Comments
 (0)