install: fix posix compliance

This commit is contained in:
CJ van den Berg 2025-10-22 13:11:08 +02:00
parent 1d8dd56e16
commit 16b7bfc86a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
set -e set -e
install_dir="${PREFIX:-/usr/local}/bin" install_dir="${PREFIX:-/usr/local}/bin"
@ -206,7 +206,7 @@ url="https://github.com/$repo/releases/download/$version/$filename.$ext"
tmp_path="$(mktemp -t -d "$(basename "$0").XXXXX")" tmp_path="$(mktemp -t -d "$(basename "$0").XXXXX")"
if [ -z "$tmp_path" ] || [ "$tmp_path" == "/" ]; then if [ -z "$tmp_path" ] || [ "$tmp_path" = "/" ]; then
echo "failed to create a temporary download directory" echo "failed to create a temporary download directory"
exit 1 exit 1
fi fi
@ -220,11 +220,10 @@ die() {
exit 1 exit 1
} }
trap die SIGINT trap die INT
trap die SIGHUP trap die HUP
trap die SIGTERM trap die TERM
trap die SIGQUIT trap die QUIT
trap die ERR
trap cleanup EXIT trap cleanup EXIT
echo "downloading $title... to $tmp_path" echo "downloading $title... to $tmp_path"