Skip to content

Commit

Permalink
nvm: add option to disable nvm
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmrcaga committed Jun 2, 2022
1 parent fb6a5f9 commit 53de32e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions action.yml
Expand Up @@ -53,6 +53,11 @@ inputs:
required: false
default: ''

use_nvm:
description: 'Enables you to disable nvm altogether'
required: false
default: true

outputs:
NETLIFY_OUTPUT:
description: "netlify command output"
Expand Down
12 changes: 9 additions & 3 deletions entrypoint.sh
Expand Up @@ -8,15 +8,21 @@ npm i -g netlify-cli
# Save its exec path to run later
NETLIFY_CLI=$(which netlify)

NODE_VERSION=$9

# We can start using INPUT_ notation instead of passing
# env variables as arg to docker
USE_NVM=$INPUT_USE_NVM

# Install node from NVM to honor .nvmrc files
if [[ -n $9 ]] || [[ -e ".nvmrc" ]]
if [[ $USE_NVM == "true" ]] && ([[ -n $NODE_VERSION ]] || [[ -e ".nvmrc" ]])
then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
[ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"

if [[ -n $9 ]]
if [[ -n $NODE_VERSION ]]
then
nvm install "$9"
nvm install "$NODE_VERSION"
else
nvm install
fi
Expand Down

0 comments on commit 53de32e

Please sign in to comment.