Skip to content

Commit

Permalink
Inputs: do not run nvm if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmrcaga committed Dec 28, 2021
1 parent 2fe02b2 commit fb6a5f9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions entrypoint.sh
Expand Up @@ -9,10 +9,18 @@ npm i -g netlify-cli
NETLIFY_CLI=$(which netlify)

# Install node from NVM to honor .nvmrc files
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 ]] || [[ -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"

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

NETLIFY_AUTH_TOKEN=$1
NETLIFY_SITE_ID=$2
Expand Down Expand Up @@ -62,4 +70,4 @@ NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*'
echo "::set-output name=NETLIFY_OUTPUT::$NETLIFY_OUTPUT"
echo "::set-output name=NETLIFY_PREVIEW_URL::$NETLIFY_PREVIEW_URL"
echo "::set-output name=NETLIFY_LOGS_URL::$NETLIFY_LOGS_URL"
echo "::set-output name=NETLIFY_LIVE_URL::$NETLIFY_LIVE_URL"
echo "::set-output name=NETLIFY_LIVE_URL::$NETLIFY_LIVE_URL"

0 comments on commit fb6a5f9

Please sign in to comment.