Skip to content

Commit 358f1ec

Browse files
authored
Merge pull request #3 from buildkite-plugins/explicitly-specify-workdir
shellcheck no longer assumes /mnt
2 parents b0849e1 + 777c435 commit 358f1ec

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

hooks/command

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if [[ -z ${files:-} ]] ; then
3535
fi
3636

3737
echo "+++ Running shellcheck on ${#files[@]} files"
38-
if docker run --rm -v "$PWD:/mnt" koalaman/shellcheck "${files[@]}" ; then
38+
if docker run --rm -v "$PWD:/mnt" --workdir "/mnt" koalaman/shellcheck "${files[@]}" ; then
3939
echo "Files are ok ✅"
4040
else
4141
exit 1

tests/run.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load '/usr/local/lib/bats/load.bash'
88
export BUILDKITE_PLUGIN_SHELLCHECK_FILES_0="tests/testdata/test.sh"
99

1010
stub docker \
11-
"run --rm -v $PWD:/mnt koalaman/shellcheck tests/testdata/test.sh : echo testing test.sh"
11+
"run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck tests/testdata/test.sh : echo testing test.sh"
1212

1313
run "$PWD/hooks/command"
1414

@@ -24,7 +24,7 @@ load '/usr/local/lib/bats/load.bash'
2424
export BUILDKITE_PLUGIN_SHELLCHECK_FILES_2="missing"
2525

2626
stub docker \
27-
"run --rm -v $PWD:/mnt koalaman/shellcheck tests/testdata/test.sh tests/testdata/subdir/llamas.sh tests/testdata/subdir/shell\ with\ space.sh' : echo testing test.sh"
27+
"run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck tests/testdata/test.sh tests/testdata/subdir/llamas.sh tests/testdata/subdir/shell\ with\ space.sh' : echo testing test.sh"
2828

2929
run "$PWD/hooks/command"
3030

@@ -38,7 +38,7 @@ load '/usr/local/lib/bats/load.bash'
3838
export BUILDKITE_PLUGIN_SHELLCHECK_FILES_0="tests/testdata/subdir/llamas.sh"
3939

4040
stub docker \
41-
"run --rm -v $PWD:/mnt koalaman/shellcheck tests/testdata/test.sh tests/testdata/subdir/llamas.sh tests/testdata/subdir/shell\ with\ space.sh' : echo shellcheck failed; exit 1"
41+
"run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck tests/testdata/test.sh tests/testdata/subdir/llamas.sh tests/testdata/subdir/shell\ with\ space.sh' : echo shellcheck failed; exit 1"
4242

4343
run "$PWD/hooks/command"
4444

0 commit comments

Comments
 (0)