From 14696fd5f6f779205ef0bef2d63d1ebcb7b23a5d Mon Sep 17 00:00:00 2001 From: Michael Greenberg Date: Tue, 19 Nov 2024 11:23:45 -0500 Subject: [PATCH] satisfy shellcheck --- test/tempfiles.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/tempfiles.sh b/test/tempfiles.sh index bc2cb73..66daae6 100755 --- a/test/tempfiles.sh +++ b/test/tempfiles.sh @@ -1,4 +1,5 @@ #!/bin/sh +# shellcheck disable=SC2010,SC2126,SC2181 TRY_TOP="${TRY_TOP:-$(git rev-parse --show-toplevel --show-superproject-working-tree 2>/dev/null || echo "${0%/*}")}" TRY="$TRY_TOP/try" @@ -17,11 +18,9 @@ post_count="$(ls "${TMPDIR-/tmp}" | grep -e "^.*\.try-[0-9]*$" | wc -l)" # deliberately not the pattern of try sandboxes sandbox="$(mktemp -d --suffix "custom-XXXXXX")" $TRY -D "$sandbox" "touch $HOME/bar" || exit 5 -[ $? -eq 0 ] || exit 6 final_count="$(ls "${TMPDIR-/tmp}" | grep -e "^.*\.try-[0-9]*$" | wc -l)" # no new tempfiles! -echo $post_count $final_count -[ "$post_count" -eq "$final_count" ] || exit 7 -[ -f "$sandbox/upperdir$HOME/bar" ] || exit 8 +[ "$post_count" -eq "$final_count" ] || exit 6 +[ -f "$sandbox/upperdir$HOME/bar" ] || exit 7