Clean up shell scripts

Some changes fix actual problems, e.g. missing spaces in square bracket tests,
and backticks unintentionally causing code execution when intended as formatting.

Others, such as conservative quoting probably work fine in the old version in
most situations, but it's nice to have some additional safety.

Using `{ ..; }` instead of `(..)` is just a small performance enhancement.

Many of these issues were identified by shellcheck, which might be useful in CI
as well.
This commit is contained in:
Daniel Rainer
2025-04-24 00:38:30 +02:00
committed by Johannes Altmanninger
parent b431873ce5
commit e10573088a
11 changed files with 32 additions and 32 deletions

View File

@@ -1,4 +1,6 @@
#!/bin/bash
#!/bin/sh
set -e
# This script is copied into the root directory of our Docker tests.
# It is the entry point for running Docker-based tests.
@@ -10,10 +12,10 @@ cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug /fish-source "$@"
# Spawn a shell if FISH_RUN_SHELL_BEFORE_TESTS is set.
if test -n "$FISH_RUN_SHELL_BEFORE_TESTS"
then
bash -i || exit
bash -i
fi
ninja && ninja fish_run_tests
(set +e; ninja && ninja fish_run_tests)
RES=$?
# Drop the user into a shell if FISH_RUN_SHELL_AFTER_TESTS is set.