Skip to content

Commit

Permalink
Merge pull request #3 from buildkite-plugins/explicitly-specify-workdir
Browse files Browse the repository at this point in the history
shellcheck no longer assumes /mnt
  • Loading branch information
toolmantim authored Apr 26, 2018
2 parents b0849e1 + 777c435 commit 358f1ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hooks/command
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ -z ${files:-} ]] ; then
fi

echo "+++ Running shellcheck on ${#files[@]} files"
if docker run --rm -v "$PWD:/mnt" koalaman/shellcheck "${files[@]}" ; then
if docker run --rm -v "$PWD:/mnt" --workdir "/mnt" koalaman/shellcheck "${files[@]}" ; then
echo "Files are ok ✅"
else
exit 1
Expand Down
6 changes: 3 additions & 3 deletions tests/run.bats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load '/usr/local/lib/bats/load.bash'
export BUILDKITE_PLUGIN_SHELLCHECK_FILES_0="tests/testdata/test.sh"

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

run "$PWD/hooks/command"

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

stub docker \
"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"
"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"

run "$PWD/hooks/command"

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

stub docker \
"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"
"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"

run "$PWD/hooks/command"

Expand Down

0 comments on commit 358f1ec

Please sign in to comment.