Skip to content
Myr

Merge pull request #1676 from Quadric/fix-node-version-in-install-script

Before adoption: this commit came in with the history the project adopted, so no landing records it.

`install.sh`: Fix a bug that block that installation of node in install.sh

authored by Jordan Harband · committed by GitHub · parents a57fe84, bacdd95 · Browse files · 2 files+16 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−8 removed

  • tests:+8 added−0 removed
  • other:+8 added−8 removed

2 files+16 added−8 removed

added:test/install_script/nvm_install_with_node_version+8 added
1#!/bin/sh23die () { echo "$@" ; exit 1; }45NODE_VERSION=8 \. ../../install.sh67# nvm installed node 88nvm ls 8 > /dev/null 2>&1 || die "nvm didn't install node 8"
modified:install.sh+8 added-8 removed
138 unmodified lines
139#140# Automatically install Node.js141#142nvm_install_node() {143 local NODE_VERSION144 NODE_VERSION="$(nvm_node_version)"143 local NODE_VERSION_LOCAL144 NODE_VERSION_LOCAL="$(nvm_node_version)"145146 if [ -z "$NODE_VERSION" ]; then146 if [ -z "$NODE_VERSION_LOCAL" ]; then147 return 0148 fi149150 echo "=> Installing Node.js version $NODE_VERSION"151 nvm install "$NODE_VERSION"150 echo "=> Installing Node.js version $NODE_VERSION_LOCAL"151 nvm install "$NODE_VERSION_LOCAL"152 local CURRENT_NVM_NODE153154 CURRENT_NVM_NODE="$(nvm_version current)"155 if [ "$(nvm_version "$NODE_VERSION")" == "$CURRENT_NVM_NODE" ]; then156 echo "=> Node.js version $NODE_VERSION has been successfully installed"155 if [ "$(nvm_version "$NODE_VERSION_LOCAL")" == "$CURRENT_NVM_NODE" ]; then156 echo "=> Node.js version $NODE_VERSION_LOCAL has been successfully installed"157 else158 echo >&2 "Failed to install Node.js $NODE_VERSION"158 echo >&2 "Failed to install Node.js $NODE_VERSION_LOCAL"159 fi160}161162install_nvm_as_script() {
233 unmodified lines