make{Script; Binary}Wrapper: log if target file does not exist (#384765)

This commit is contained in:
Arne Keller 2026-07-04 10:59:59 +00:00 committed by GitHub
commit 74ebbfaf0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -3,6 +3,8 @@
# assertExecutable FILE
assertExecutable() {
local file="$1"
[[ -e "$file" ]] || \
die "Cannot wrap '$file' because it does not exist"
[[ -f "$file" && -x "$file" ]] || \
die "Cannot wrap '$file' because it is not an executable file"
}

View file

@ -6,6 +6,8 @@ set -euo pipefail
# assertExecutable FILE
assertExecutable() {
local file="$1"
[[ -e "$file" ]] || \
die "Cannot wrap '$file' because it does not exist"
[[ -f "$file" && -x "$file" ]] || \
die "Cannot wrap '$file' because it is not an executable file"
}