diff --git a/action.yml b/action.yml index a526291..df6a81f 100644 --- a/action.yml +++ b/action.yml @@ -205,6 +205,11 @@ runs: fi # Set nvmdir explicitly before installation. Default dir doesn't work for some reason. export NVM_DIR="${HOME}/.nvm" + # Installation fails if install dir is specified but doesn't exist + if ! [[ -d "$NVM_DIR" ]]; then + echo "NVM_DIR '$NVM_DIR' doesn't exist - creating it now" + mkdir $NVM_DIR + fi # Remove any sneaky attempts to put __install-nvm.sh into pull-requests if [[ -f __install-nvm.sh ]]; then rm __install-nvm.sh @@ -218,7 +223,7 @@ runs: exit 1 fi # this loads nvm into the current terminal - [[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" + [[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh" --no-use ADMIN_NPM_VERSION= if [[ -d vendor/silverstripe/admin ]]; then cd vendor/silverstripe/admin