From 81a115be7ff0cf6496ef4af6323e49a697d76c75 Mon Sep 17 00:00:00 2001 From: Giacomo Vercesi Date: Wed, 11 Feb 2026 12:23:10 +0100 Subject: [PATCH 1/2] common.sh: add shellcheck marker --- common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/common.sh b/common.sh index 6fee7ee1..adf8745f 100644 --- a/common.sh +++ b/common.sh @@ -1,3 +1,4 @@ +# shellcheck shell=bash # Strict bash set -euo pipefail From 63e58adaf467760b605147683c66ecaf5134cbf4 Mon Sep 17 00:00:00 2001 From: Giacomo Vercesi Date: Wed, 11 Feb 2026 12:23:43 +0100 Subject: [PATCH 2/2] common.sh: do not assume `$PWD` when checking When checking if the output has been produced, use the absolute path as opposed to the relative one as the sourcing script might have changed directories in the meantime. --- common.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common.sh b/common.sh index adf8745f..6648bbfd 100644 --- a/common.sh +++ b/common.sh @@ -4,6 +4,9 @@ set -euo pipefail COMMAND_NAME="$1" OUTPUT="${2-}" +if [[ -n "$OUTPUT" ]]; then + _OUTPUT_ABSOLUTE=$(realpath "$OUTPUT") +fi TEMPORARIES_LOG=$(mktemp --tmpdir tmp."$COMMAND_NAME"-temp-log.XXXXXXXXXX) function temp() { @@ -20,7 +23,7 @@ function at_exit() { rm -f "$TEMPORARIES_LOG" # If this command has any output, ensure it has been produced - if [[ -n "$OUTPUT" && ! -e "$OUTPUT" ]]; then + if [[ -n "$OUTPUT" && ! -e "$_OUTPUT_ABSOLUTE" ]]; then echo "Output not produced" > /dev/stderr exit 1 fi