don't bother with symlinks when updating

This commit is contained in:
yosh 2024-02-02 17:22:43 -05:00
parent 66ffa456eb
commit 9fbbc2fbb6
1 changed files with 10 additions and 3 deletions

View File

@ -8,8 +8,6 @@ set -euf
BN="${0##*/}"
NL='
'
export POSIXLY_CORRECT=1
if [ -n "${NO_COLOR:-}" ]; then
RED="" GREEN="" YELLOW="" RESET=""
fi
@ -50,7 +48,16 @@ checkupdate() {
printf '%s' "if you don't use git, apply update directly? [y/n] " >&2
read -r choice
case "$choice" in
[Yy]) chmod +x "$tmpupdate" && mv -f "$tmpupdate" "$0" && errecho "updated!" || fail "applying update failed! retry probably" ;;
[Yy])
if [ -L "$0" ]; then
errecho "${RED}your flacconv patch is a symbolic link."
errecho "while it is possible to resolve them in a POSIX manner, it's a weird amount of code"
errecho "so I humbly ask that you update it manually"
exit 1
fi
mv -f "$tmpupdate" "$0"
errecho "updated!"
;;
*) errecho "not applying update!" ;;
esac
fi