don't bother with symlinks when updating
This commit is contained in:
parent
66ffa456eb
commit
9fbbc2fbb6
13
flacconv
13
flacconv
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue