test.sh: make shellcheck happy

This commit is contained in:
Xiretza 2022-12-01 19:19:10 +01:00
parent bb0fbc0f8f
commit 0ce9b79c20

View file

@ -11,12 +11,12 @@ OUTDIR=$(mktemp --directory)
trap "rm -rf '$OUTDIR'" EXIT trap "rm -rf '$OUTDIR'" EXIT
run_solution() { run_solution() {
if [ -d "$solution" ]; then if [[ -d "$solution" ]]; then
if [ -f "$solution/Cargo.toml" ]; then if [[ -f "$solution/Cargo.toml" ]]; then
cargo run --quiet --manifest-path "$solution/Cargo.toml" < "$input" cargo run --quiet --manifest-path "$solution/Cargo.toml" < "$input"
else else
runfile=$solution/run.sh runfile=$solution/run.sh
[ -f "$runfile" ] || { echo "Error: $runfile not found" >&2; exit 1; } [[ -f "$runfile" ]] || { echo "Error: $runfile not found" >&2; exit 1; }
"$runfile" "$input" "$runfile" "$input"
fi fi
else else
@ -49,6 +49,9 @@ do_day() {
example*) example*)
echo SKIP echo SKIP
continue continue
;;
*)
;;
esac esac
solution_output=$OUTDIR/${year}_$day.out solution_output=$OUTDIR/${year}_$day.out