Modified to work with missing HOME environment variable under Windows

The HOME environment variable is not set on Windows by default. Instead Windows uses USERPROFILE. It is possible for HOME to be set on Windows but for users who have not done this they will get: `HOME: unbound variable`. I have added a line that sets HOME to USERPROFILE if HOME is missing and USERPROFILE is found. This solves the unbound variable error.
This commit is contained in:
SendSpams 2018-04-06 07:02:00 +01:00 committed by GitHub
parent 2ae7e326bb
commit 120f02fe07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@ codec=libmp3lame
extension=mp3 extension=mp3
mode=chaptered mode=chaptered
authcode=".authcode"; authcode=".authcode";
authcodeDirs="${HOME}/ ./"; if [ -z ${HOME+x} ] && ! [ -z ${USERPROFILE+x} ]; then HOME="$USERPROFILE"; fi
GREP=$(grep --version | grep -q GNU && echo "grep" || echo "ggrep") GREP=$(grep --version | grep -q GNU && echo "grep" || echo "ggrep")
if ! [[ $(type -P "$GREP") ]]; then if ! [[ $(type -P "$GREP") ]]; then