diff --git a/src/main/resources/scripts/gvm-init.sh b/src/main/resources/scripts/gvm-init.sh index fe65eb4e..bc04df9a 100755 --- a/src/main/resources/scripts/gvm-init.sh +++ b/src/main/resources/scripts/gvm-init.sh @@ -17,7 +17,21 @@ # export GVM_VERSION="@GVM_VERSION@" -export GVM_PLATFORM=$(uname -o) +export GVM_PLATFORM=$(uname) + +# OS specific support (must be 'true' or 'false'). +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) + cygwin=true + ;; + + Darwin*) + darwin=true + ;; +esac + if [ -z "${GVM_SERVICE}" ]; then export GVM_SERVICE="@GVM_SERVICE@" diff --git a/src/main/resources/scripts/install.sh b/src/main/resources/scripts/install.sh index 4efa799e..4f47cc95 100755 --- a/src/main/resources/scripts/install.sh +++ b/src/main/resources/scripts/install.sh @@ -41,6 +41,18 @@ gvm_init_snippet=$( cat << EOF EOF ) +# OS specific support (must be 'true' or 'false'). +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) + cygwin=true + ;; + + Darwin*) + darwin=true + ;; +esac echo ' ' @@ -170,7 +182,7 @@ echo "Download script archive..." curl -s "${GVM_SERVICE}/res?platform=${gvm_platform}&purpose=install" > "${gvm_zip_file}" echo "Extract script archive..." -if [[ $(uname -o) == "Cygwin" ]]; then +if [[ "${cygwin}" == 'true' ]]; then echo "Cygwin detected - normalizing paths for unzip..." unzip -qo $(cygpath -w "${gvm_zip_file}") -d $(cygpath -w "${gvm_stage_folder}") else diff --git a/src/main/resources/scripts/selfupdate.sh b/src/main/resources/scripts/selfupdate.sh index b5c28952..cc309b33 100755 --- a/src/main/resources/scripts/selfupdate.sh +++ b/src/main/resources/scripts/selfupdate.sh @@ -23,6 +23,19 @@ if [ -z "${GVM_DIR}" ]; then GVM_DIR="$HOME/.gvm" fi +# OS specific support (must be 'true' or 'false'). +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) + cygwin=true + ;; + + Darwin*) + darwin=true + ;; +esac + gvm_platform=$(uname -o) gvm_bin_folder="${GVM_DIR}/bin" gvm_tmp_zip="${GVM_DIR}/tmp/res-${GVM_VERSION}.zip" @@ -66,7 +79,7 @@ curl -s "${GVM_SERVICE}/res?platform=${gvm_platform}&purpose=selfupdate" > "${gv echo "Extract script archive..." echo "Unziping scripts to: ${gvm_stage_folder}" -if [[ $(uname -o) == "Cygwin" ]]; then +if [[ "${cygwin}" == 'true' ]]; then echo "Cygwin detected - normalizing paths for unzip..." unzip -qo $(cygpath -w "${gvm_tmp_zip}") -d $(cygpath -w "${gvm_stage_folder}") else