Split out of #396, which fixed the bugs that stopped scripts/acceptance from
working at all. Two things it deliberately left, both outside that diff.
sed -i '' is BSD-only
scripts/acceptance/test.sh truncates its output with
sed -i '' -e "/^Found /d" $TEMP_PATH/mado.txt > /dev/null
GNU sed takes the suffix attached to the flag (-i.bak), so the standalone
'' is read as an input filename and each call fails with
sed: can't read : No such file or directory. #396 made dash -n pass on the
file, but that is only the parser; the script still cannot run on Linux.
Worth deciding rather than patching: either commit to macOS and say so in the
script, or make it portable — a temporary file and mv, or perl -i -pe,
avoids the BSD/GNU split entirely.
While there, the > /dev/null on those three lines does nothing: -i writes
to the file, and the errors that do appear go to stderr.
Quoting
shellcheck reports SC2086 and friends across
scripts/acceptance/*.sh and scripts/benchmarks/*.sh — 32 findings after
#396. None misbehaves today, because no fixture filename contains a space or a
glob character, and find output is word-split by the for loop regardless,
so quoting alone would not make that loop robust.
This is the mechanical half deferred from #396, and it should land with
whatever linter enforces it rather than before. Whether that linter is
shellcheck is part of #397.
Split out of #396, which fixed the bugs that stopped
scripts/acceptancefromworking at all. Two things it deliberately left, both outside that diff.
sed -i ''is BSD-onlyscripts/acceptance/test.shtruncates its output withGNU sed takes the suffix attached to the flag (
-i.bak), so the standalone''is read as an input filename and each call fails withsed: can't read : No such file or directory. #396 madedash -npass on thefile, but that is only the parser; the script still cannot run on Linux.
Worth deciding rather than patching: either commit to macOS and say so in the
script, or make it portable — a temporary file and
mv, orperl -i -pe,avoids the BSD/GNU split entirely.
While there, the
> /dev/nullon those three lines does nothing:-iwritesto the file, and the errors that do appear go to stderr.
Quoting
shellcheckreportsSC2086and friends acrossscripts/acceptance/*.shandscripts/benchmarks/*.sh— 32 findings after#396. None misbehaves today, because no fixture filename contains a space or a
glob character, and
findoutput is word-split by theforloop regardless,so quoting alone would not make that loop robust.
This is the mechanical half deferred from #396, and it should land with
whatever linter enforces it rather than before. Whether that linter is
shellcheckis part of #397.