99
1010export NODE_VERSION=" ${VERSION:- " lts" } "
1111export NVM_VERSION=" ${NVMVERSION:- " 0.39.2" } "
12- export NVM_DIR=${NVMINSTALLPATH:- " /usr/local/share/nvm" }
12+ export NVM_DIR=" ${NVMINSTALLPATH:- " /usr/local/share/nvm" } "
1313INSTALL_TOOLS_FOR_NODE_GYP=" ${NODEGYPDEPENDENCIES:- true} "
1414
1515# Comma-separated list of node versions to be installed (with nvm)
@@ -118,10 +118,10 @@ set -e
118118umask 0002
119119# Do not update profile - we'll do this manually
120120export PROFILE=/dev/null
121- curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION} /install.sh | bash
122- source ${NVM_DIR} /nvm.sh
121+ curl -so- " https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION} /install.sh" | bash
122+ source " ${NVM_DIR} /nvm.sh"
123123if [ "${NODE_VERSION} " != "" ]; then
124- nvm alias default ${NODE_VERSION}
124+ nvm alias default " ${NODE_VERSION} "
125125fi
126126EOF
127127) "
@@ -149,9 +149,9 @@ usermod -a -G nvm ${USERNAME}
149149umask 0002
150150if [ ! -d " ${NVM_DIR} " ]; then
151151 # Create nvm dir, and set sticky bit
152- mkdir -p ${NVM_DIR}
153- chown " ${USERNAME} :nvm" ${NVM_DIR}
154- chmod g+rws ${NVM_DIR}
152+ mkdir -p " ${NVM_DIR} "
153+ chown " ${USERNAME} :nvm" " ${NVM_DIR} "
154+ chmod g+rws " ${NVM_DIR} "
155155 su ${USERNAME} -c " ${nvm_install_snippet} " 2>&1
156156 # Update rc files
157157 if [ " ${UPDATE_RC} " = " true" ]; then
@@ -160,11 +160,11 @@ if [ ! -d "${NVM_DIR}" ]; then
160160else
161161 echo " NVM already installed."
162162 if [ " ${NODE_VERSION} " != " " ]; then
163- su ${USERNAME} -c " umask 0002 && . $NVM_DIR /nvm.sh && nvm install ${NODE_VERSION} && nvm alias default ${NODE_VERSION} "
163+ su ${USERNAME} -c " umask 0002 && . ' $NVM_DIR /nvm.sh' && nvm install ' ${NODE_VERSION} ' && nvm alias default ' ${NODE_VERSION} ' "
164164 fi
165165fi
166166
167- # Additional node versions to be installed but not be set as
167+ # Additional node versions to be installed but not be set as
168168# default we can assume the nvm is the group owner of the nvm
169169# directory and the sticky bit on directories so any installed
170170# files will have will have the correct ownership (nvm)
@@ -173,12 +173,12 @@ if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
173173 IFS=" ,"
174174 read -a additional_versions <<< " $ADDITIONAL_VERSIONS"
175175 for ver in " ${additional_versions[@]} " ; do
176- su ${USERNAME} -c " umask 0002 && . $NVM_DIR /nvm.sh && nvm install ${ver} "
176+ su ${USERNAME} -c " umask 0002 && . ' $NVM_DIR /nvm.sh' && nvm install ' ${ver} ' "
177177 done
178178
179179 # Ensure $NODE_VERSION is on the $PATH
180180 if [ " ${NODE_VERSION} " != " " ]; then
181- su ${USERNAME} -c " umask 0002 && . $NVM_DIR /nvm.sh && nvm use default"
181+ su ${USERNAME} -c " umask 0002 && . ' $NVM_DIR /nvm.sh' && nvm use default"
182182 fi
183183 IFS=$OLDIFS
184184fi
218218
219219
220220# Clean up
221- su ${USERNAME} -c " umask 0002 && . $NVM_DIR /nvm.sh && nvm clear-cache"
221+ su ${USERNAME} -c " umask 0002 && . ' $NVM_DIR /nvm.sh' && nvm clear-cache"
222222rm -rf /var/lib/apt/lists/*
223223
224224# Ensure privs are correct for installed node versions. Unfortunately the
0 commit comments