Skip to content

Commit

Permalink
satisfy shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mgree committed Nov 19, 2024
1 parent a24bd3d commit 14696fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/tempfiles.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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

0 comments on commit 14696fd

Please sign in to comment.