use backup tput commands in case setf fails

This commit is contained in:
yosh 2023-04-15 13:30:56 -04:00
parent c936bcb704
commit 22ac378902
1 changed files with 8 additions and 8 deletions

View File

@ -1,14 +1,14 @@
#!/bin/sh
# flacconv 1.4.0 // use https://github.com/yoshiyoshyosh/flacconv for issues
# flacconv 1.4.1 // use https://github.com/yoshiyoshyosh/flacconv for issues
GREEN="$(tput setf 2)" || GREEN="$(tput setaf 2)"
RED="$(tput setf 4)" || RED="$(tput setaf 1)"
YELLOW="$(tput setf 6)" || YELLOW="$(tput setaf 3)"
RESET="$(tput sgr0)"
set -euf
BN="${0##*/}"
POSIXLY_CORRECT=1
GREEN="$(tput setf 2)"
RED="$(tput setf 4)"
YELLOW="$(tput setf 6)"
RESET="$(tput sgr0)"
if [ "${NO_COLOR:-}" ]; then
GREEN=
@ -49,12 +49,12 @@ _tempdir() {
checkupdate() {
errecho 'checking for updates...'
if curl -s https://raw.githubusercontent.com/yoshiyoshyosh/flacconv/main/flacconv | cmp -s "$0" -; then
if curl -s https://github.com/yoshiyoshyosh/flacconv/releases/latest/download/flacconv | cmp -s "$0" -; then
errecho 'your script is updated to the latest version!'
else
errecho 'your script differs from remote!'
errecho 'if this is unintentional, download the newest version from:'
errecho 'https://raw.githubusercontent.com/yoshiyoshyosh/flacconv/main/flacconv'
errecho 'if this is unintentional, download the newest version from'
errecho 'https://github.com/yoshiyoshyosh/flacconv/releases/latest'
fi
exit 0
}