Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvm: add option to disable nvm #33

Merged
merged 1 commit into from Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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