From 120f02fe0772a8df332d559ffa3d0fb30ff9b564 Mon Sep 17 00:00:00 2001 From: SendSpams <36188980+SendSpams@users.noreply.github.com> Date: Fri, 6 Apr 2018 07:02:00 +0100 Subject: [PATCH] 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. --- AAXtoMP3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AAXtoMP3 b/AAXtoMP3 index e53b8de..6c9778b 100755 --- a/AAXtoMP3 +++ b/AAXtoMP3 @@ -6,7 +6,7 @@ codec=libmp3lame extension=mp3 mode=chaptered 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") if ! [[ $(type -P "$GREP") ]]; then