Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e562a5645b | ||
|
|
c0c5e8d7ef | ||
|
|
f00d688c87 | ||
|
|
5aa78f21cf | ||
|
|
4a7275a0c6 | ||
|
|
c77be55cdc | ||
|
|
e195fccdb7 | ||
|
|
87516039a8 | ||
|
|
80e349edb1 | ||
|
|
038c1f3d0f | ||
|
|
66455f7c77 | ||
|
|
a69eae10e3 | ||
|
|
13b87449e8 | ||
|
|
222250f2d1 | ||
|
|
77f4490391 | ||
|
|
0871131dfd | ||
|
|
e6bd207624 | ||
|
|
bad79e6d77 | ||
|
|
d07fa2db10 | ||
|
|
20953ab04c | ||
|
|
4cf940153c | ||
|
|
47bbf93f50 | ||
|
|
7976a1343f | ||
|
|
bf8abf1052 | ||
|
|
eb6031cb58 | ||
|
|
55a6f1f06e | ||
|
|
c188c1b11a | ||
|
|
b15ea07067 | ||
|
|
752c0e4ef1 | ||
|
|
49364532b3 | ||
|
|
9157cb4cfe |
@@ -1,7 +1,8 @@
|
||||
language: bash
|
||||
language: c # defaults to ruby
|
||||
install:
|
||||
- sudo apt-get install ksh zsh -y
|
||||
before_script:
|
||||
- curl -o /tmp/urchin https://raw.github.com/scraperwiki/urchin/master/urchin && chmod +x /tmp/urchin
|
||||
- curl -o /tmp/urchin https://raw.githubusercontent.com/scraperwiki/urchin/master/urchin && chmod +x /tmp/urchin
|
||||
script:
|
||||
- NVM_DIR=$TRAVIS_BUILD_DIR make URCHIN=/tmp/urchin test
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Node Version Manager [](https://travis-ci.org/creationix/nvm)
|
||||
# Node Version Manager [][3]
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -6,13 +6,13 @@ First you'll need to make sure your system has a c++ compiler. For OSX, XCode w
|
||||
|
||||
### Install script
|
||||
|
||||
To install you could use the [install script](https://github.com/creationix/nvm/blob/v0.3.0/install.sh) using cURL:
|
||||
To install you could use the [install script][2] using cURL:
|
||||
|
||||
curl https://raw.github.com/creationix/nvm/v0.3.0/install.sh | sh
|
||||
curl https://raw.githubusercontent.com/creationix/nvm/v0.6.0/install.sh | sh
|
||||
|
||||
or Wget:
|
||||
|
||||
wget -qO- https://raw.github.com/creationix/nvm/v0.3.0/install.sh | sh
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.6.0/install.sh | sh
|
||||
|
||||
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc` or `~/.profile`).</sub>
|
||||
|
||||
@@ -37,6 +37,9 @@ Often I also put in a line to use a specific version of node.
|
||||
|
||||
## Usage
|
||||
|
||||
You can create an `.nvmrc` file containing version number in the project root directory (or any parent directory).
|
||||
`nvm use`, `nvm install`, and `nvm run` will all respect an `.nvmrc` file.
|
||||
|
||||
To download, compile, and install the latest v0.10.x release of node, do this:
|
||||
|
||||
nvm install 0.10
|
||||
@@ -45,13 +48,9 @@ And then in any new shell just use the installed version:
|
||||
|
||||
nvm use 0.10
|
||||
|
||||
You can create an `.nvmrc` file containing version number in the project root folder; run the following command to switch versions:
|
||||
|
||||
nvm use
|
||||
|
||||
Or you can just run it:
|
||||
|
||||
nvm run 0.10
|
||||
nvm run 0.10 --version
|
||||
|
||||
If you want to see what versions are installed:
|
||||
|
||||
@@ -90,7 +89,7 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
## Running tests
|
||||
Tests are written in [Urchin](https://github.com/scraperwiki/urchin). Install Urchin (and other dependencies) like so:
|
||||
Tests are written in [Urchin]. Install Urchin (and other dependencies) like so:
|
||||
|
||||
npm install
|
||||
|
||||
@@ -163,3 +162,8 @@ After the v0.8.6 release of node, nvm tries to install from binary packages. But
|
||||
|
||||
nvm install -s 0.8.6
|
||||
|
||||
[1]: https://github.com/creationix/nvm.git
|
||||
[2]: https://github.com/creationix/nvm/blob/v0.6.0/install.sh
|
||||
[3]: https://travis-ci.org/creationix/nvm
|
||||
[Urchin]: https://github.com/scraperwiki/urchin
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ install_from_git() {
|
||||
|
||||
install_as_script() {
|
||||
if [ -z "$NVM_SOURCE" ]; then
|
||||
NVM_SOURCE="https://raw.github.com/creationix/nvm/master/nvm.sh"
|
||||
NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh"
|
||||
fi
|
||||
|
||||
# Downloading to $NVM_DIR
|
||||
|
||||
9
nvm-exec
9
nvm-exec
@@ -4,12 +4,11 @@ DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
source "$DIR/nvm.sh"
|
||||
|
||||
if [ ! "$NODE_VERSION" ]; then
|
||||
echo 'NODE_VERSION not set'
|
||||
exit 1
|
||||
if [ -n "$NODE_VERSION" ]; then
|
||||
nvm use $NODE_VERSION || (echo "NODE_VERSION not set" && exit 127)
|
||||
else
|
||||
nvm use || (echo "No .nvmrc file found" && exit 127)
|
||||
fi
|
||||
|
||||
nvm use $NODE_VERSION
|
||||
|
||||
exec $@
|
||||
|
||||
|
||||
104
nvm.sh
104
nvm.sh
@@ -34,11 +34,30 @@ if [ -z "$NVM_NODEJS_ORG_MIRROR" ]; then
|
||||
export NVM_NODEJS_ORG_MIRROR="http://nodejs.org/dist"
|
||||
fi
|
||||
|
||||
# Traverse up in directory tree to find containing folder
|
||||
nvm_find_up() {
|
||||
local path
|
||||
path=$PWD
|
||||
while [ "$path" != "" ] && [ ! -f "$path/$1" ]; do
|
||||
path=${path%/*}
|
||||
done
|
||||
echo "$path"
|
||||
}
|
||||
|
||||
|
||||
nvm_find_nvmrc() {
|
||||
local dir="$(nvm_find_up '.nvmrc')"
|
||||
if [ -e "$dir/.nvmrc" ]; then
|
||||
echo "$dir/.nvmrc"
|
||||
fi
|
||||
}
|
||||
|
||||
# Obtain nvm version from rc file
|
||||
nvm_rc_version() {
|
||||
if [ -e .nvmrc ]; then
|
||||
NVM_RC_VERSION=`cat .nvmrc | head -n 1`
|
||||
echo "Found .nvmrc files with version <$NVM_RC_VERSION>"
|
||||
local NVMRC_PATH="$(nvm_find_nvmrc)"
|
||||
if [ -e "$NVMRC_PATH" ]; then
|
||||
NVM_RC_VERSION=`cat "$NVMRC_PATH" | head -n 1`
|
||||
echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -77,7 +96,7 @@ nvm_normalize_version() {
|
||||
nvm_format_version() {
|
||||
echo "$1" | sed -e 's/^\([0-9]\)/v\1/g'
|
||||
}
|
||||
|
||||
|
||||
nvm_binary_available() {
|
||||
# binaries started with node 0.8.6
|
||||
local MINIMAL="0.8.6"
|
||||
@@ -205,10 +224,10 @@ nvm() {
|
||||
echo "Usage:"
|
||||
echo " nvm help Show this message"
|
||||
echo " nvm --version Print out the latest released version of nvm"
|
||||
echo " nvm install [-s] <version> Download and install a <version>, [-s] from source"
|
||||
echo " nvm install [-s] <version> Download and install a <version>, [-s] from source. Uses .nvmrc if available"
|
||||
echo " nvm uninstall <version> Uninstall a version"
|
||||
echo " nvm use <version> Modify PATH to use <version>"
|
||||
echo " nvm run <version> [<args>] Run <version> with <args> as arguments"
|
||||
echo " nvm use <version> Modify PATH to use <version>. Uses .nvmrc if available"
|
||||
echo " nvm run <version> [<args>] Run <version> with <args> as arguments. Uses .nvmrc if available for <version>"
|
||||
echo " nvm current Display currently activated version"
|
||||
echo " nvm ls List installed versions"
|
||||
echo " nvm ls <version> List versions matching a given description"
|
||||
@@ -238,6 +257,8 @@ nvm() {
|
||||
local sum
|
||||
local tarball
|
||||
local nobinary
|
||||
local version_not_provided=0
|
||||
local provided_version
|
||||
|
||||
if ! nvm_has "curl"; then
|
||||
echo 'NVM Needs curl to proceed.' >&2;
|
||||
@@ -245,8 +266,12 @@ nvm() {
|
||||
fi
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
nvm help
|
||||
return
|
||||
version_not_provided=1
|
||||
nvm_rc_version
|
||||
if [ -z "$NVM_RC_VERSION" ]; then
|
||||
nvm help
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
shift
|
||||
@@ -261,9 +286,16 @@ nvm() {
|
||||
nobinary=1
|
||||
fi
|
||||
|
||||
[ -d "$NVM_DIR/$1" ] && echo "$1 is already installed." && return
|
||||
provided_version=$1
|
||||
if [ -z "$provided_version" ]; then
|
||||
if [ $version_not_provided -ne 1 ]; then
|
||||
nvm_rc_version
|
||||
fi
|
||||
provided_version="$NVM_RC_VERSION"
|
||||
fi
|
||||
[ -d "$NVM_DIR/$provided_version" ] && echo "$provided_version is already installed." && return
|
||||
|
||||
VERSION=`nvm_remote_version $1`
|
||||
VERSION=`nvm_remote_version $provided_version`
|
||||
ADDITIONAL_PARAMETERS=''
|
||||
|
||||
shift
|
||||
@@ -276,6 +308,11 @@ nvm() {
|
||||
|
||||
[ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return
|
||||
|
||||
if [ "$VERSION" = "N/A" ]; then
|
||||
echo "Version '$VERSION' not found - try \`nvm ls-remote\` to browse available versions."
|
||||
return 3
|
||||
fi
|
||||
|
||||
# skip binary install if no binary option specified.
|
||||
if [ $nobinary -ne 1 ]; then
|
||||
# shortcut - try the binary if possible.
|
||||
@@ -409,7 +446,7 @@ nvm() {
|
||||
"use" )
|
||||
if [ $# -eq 0 ]; then
|
||||
nvm help
|
||||
return
|
||||
return 127
|
||||
fi
|
||||
if [ $# -eq 1 ]; then
|
||||
nvm_rc_version
|
||||
@@ -421,7 +458,7 @@ nvm() {
|
||||
fi
|
||||
if [ -z "$VERSION" ]; then
|
||||
nvm help
|
||||
return
|
||||
return 127
|
||||
fi
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION=`nvm_version $2`
|
||||
@@ -458,12 +495,37 @@ nvm() {
|
||||
echo "Now using node $VERSION"
|
||||
;;
|
||||
"run" )
|
||||
local provided_version
|
||||
local has_checked_nvmrc=0
|
||||
# run given version of node
|
||||
if [ $# -lt 2 ]; then
|
||||
nvm help
|
||||
return
|
||||
shift
|
||||
if [ $# -lt 1 ]; then
|
||||
nvm_rc_version && has_checked_nvmrc=1
|
||||
if [ -n "$NVM_RC_VERSION" ]; then
|
||||
VERSION=`nvm_version $NVM_RC_VERSION`
|
||||
else
|
||||
VERSION='N/A'
|
||||
fi
|
||||
if [ $VERSION = "N/A" ]; then
|
||||
nvm help
|
||||
return 127
|
||||
fi
|
||||
fi
|
||||
VERSION=`nvm_version $2`
|
||||
|
||||
provided_version=$1
|
||||
if [ -n "$provided_version" ]; then
|
||||
VERSION=`nvm_version $provided_version`
|
||||
if [ $VERSION = "N/A" ]; then
|
||||
provided_version=''
|
||||
if [ $has_checked_nvmrc -ne 1 ]; then
|
||||
nvm_rc_version && has_checked_nvmrc=1
|
||||
fi
|
||||
VERSION=`nvm_version $NVM_RC_VERSION`
|
||||
else
|
||||
shift
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "$NVM_DIR/$VERSION" ]; then
|
||||
echo "$VERSION version is not installed yet"
|
||||
return;
|
||||
@@ -474,7 +536,7 @@ nvm() {
|
||||
RUN_NODE_PATH="$NVM_DIR/$VERSION/lib/node_modules:$NODE_PATH"
|
||||
fi
|
||||
echo "Running node $VERSION"
|
||||
NODE_PATH=$RUN_NODE_PATH $NVM_DIR/$VERSION/bin/node "${@:3}"
|
||||
NODE_PATH=$RUN_NODE_PATH $NVM_DIR/$VERSION/bin/node "$@"
|
||||
;;
|
||||
"ls" | "list" )
|
||||
nvm_print_versions "`nvm_ls $2`"
|
||||
@@ -526,7 +588,7 @@ nvm() {
|
||||
;;
|
||||
"unalias" )
|
||||
mkdir -p $NVM_DIR/alias
|
||||
[ $# -ne 2 ] && nvm help && return
|
||||
[ $# -ne 2 ] && nvm help && return 127
|
||||
[ ! -f "$NVM_DIR/alias/$2" ] && echo "Alias $2 doesn't exist!" && return
|
||||
rm -f $NVM_DIR/alias/$2
|
||||
echo "Deleted alias $2"
|
||||
@@ -534,7 +596,7 @@ nvm() {
|
||||
"copy-packages" )
|
||||
if [ $# -ne 2 ]; then
|
||||
nvm help
|
||||
return
|
||||
return 127
|
||||
fi
|
||||
VERSION=`nvm_version $2`
|
||||
local ROOT=`(nvm use $VERSION && npm -g root)`
|
||||
@@ -554,7 +616,7 @@ nvm() {
|
||||
nvm_version $2
|
||||
;;
|
||||
"--version" )
|
||||
echo "nvm v0.4.0"
|
||||
echo "nvm v0.6.0"
|
||||
;;
|
||||
* )
|
||||
nvm help
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nvm",
|
||||
"version": "0.4.0",
|
||||
"version": "0.6.0",
|
||||
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../nvm.sh
|
||||
|
||||
VERSION=v0.10.26
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../$VERSION ] && rm -R ../../$VERSION
|
||||
|
||||
# Install from binary
|
||||
nvm install $VERSION
|
||||
|
||||
# Check
|
||||
[ -d ../../$VERSION ]
|
||||
nvm run $VERSION --version | grep $VERSION
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../nvm.sh
|
||||
|
||||
VERSION=v0.10.26
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../$VERSION ] && rm -R ../../$VERSION
|
||||
|
||||
# Install from source
|
||||
nvm install -s $VERSION
|
||||
|
||||
# Check
|
||||
[ -d ../../$VERSION ]
|
||||
nvm run $VERSION --version | grep $VERSION
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../nvm.sh
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../v0.10.25 ] && rm -R ../../v0.10.25
|
||||
[ -e ../../v0.10.26 ] && rm -R ../../v0.10.26
|
||||
|
||||
# Install from binary
|
||||
nvm install 0.10.25
|
||||
nvm install 0.10.26
|
||||
|
||||
# Check
|
||||
[ -d ../../v0.10.25 ]
|
||||
[ -d ../../v0.10.26 ]
|
||||
|
||||
# Use the first one
|
||||
nvm use 0.10.25
|
||||
|
||||
# Use the latest one
|
||||
nvm use 0.10
|
||||
node --version | grep v0.10.26
|
||||
17
test/slow/nvm install/install from binary
Executable file
17
test/slow/nvm install/install from binary
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../../nvm.sh
|
||||
|
||||
NVM_TEST_VERSION=v0.10.7
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
|
||||
|
||||
# Install from binary
|
||||
nvm install $NVM_TEST_VERSION
|
||||
|
||||
# Check
|
||||
[ -d ../../../$NVM_TEST_VERSION ]
|
||||
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION
|
||||
|
||||
17
test/slow/nvm install/install from source
Executable file
17
test/slow/nvm install/install from source
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../../nvm.sh
|
||||
|
||||
NVM_TEST_VERSION=v0.10.7
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
|
||||
|
||||
# Install from source
|
||||
nvm install -s $NVM_TEST_VERSION
|
||||
|
||||
# Check
|
||||
[ -d ../../../$NVM_TEST_VERSION ]
|
||||
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION
|
||||
|
||||
24
test/slow/nvm install/install two versions and use the latest one
Executable file
24
test/slow/nvm install/install two versions and use the latest one
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../../nvm.sh
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../../v0.9.7 ] && rm -R ../../../v0.9.7
|
||||
[ -e ../../../v0.9.12 ] && rm -R ../../../v0.9.12
|
||||
|
||||
# Install from binary
|
||||
nvm install 0.9.7
|
||||
nvm install 0.9.12
|
||||
|
||||
# Check
|
||||
[ -d ../../../v0.9.7 ]
|
||||
[ -d ../../../v0.9.12 ]
|
||||
|
||||
# Use the first one
|
||||
nvm use 0.9.7
|
||||
|
||||
# Use the latest one
|
||||
nvm use 0.9
|
||||
node --version | grep v0.9.12
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../../nvm.sh
|
||||
|
||||
NVM_TEST_VERSION=v0.10.7
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
|
||||
|
||||
# Install from binary
|
||||
cat "$NVM_TEST_VERSION" > .nvmrc
|
||||
|
||||
nvm install
|
||||
|
||||
# Check
|
||||
[ -d ../../../$NVM_TEST_VERSION ]
|
||||
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
. ../../../nvm.sh
|
||||
|
||||
NVM_TEST_VERSION=v0.10.7
|
||||
|
||||
# Remove the stuff we're clobbering.
|
||||
[ -e ../../../$NVM_TEST_VERSION ] && rm -R ../../../$NVM_TEST_VERSION
|
||||
|
||||
# Install from binary
|
||||
cat "$NVM_TEST_VERSION" > .nvmrc
|
||||
|
||||
nvm install -s
|
||||
|
||||
# Check
|
||||
[ -d ../../../$NVM_TEST_VERSION ]
|
||||
nvm run $NVM_TEST_VERSION --version | grep $NVM_TEST_VERSION
|
||||
|
||||
|
||||
6
test/slow/nvm install/setup_dir
Executable file
6
test/slow/nvm install/setup_dir
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f ".nvmrc" ]; then
|
||||
mv .nvmrc .nvmrc.bak
|
||||
fi
|
||||
|
||||
13
test/slow/nvm install/teardown_dir
Executable file
13
test/slow/nvm install/teardown_dir
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ../../../nvm.sh
|
||||
nvm uninstall v0.10.7
|
||||
|
||||
if [ -f ".nvmrc" ]; then
|
||||
rm .nvmrc
|
||||
fi
|
||||
|
||||
if [ -f ".nvmrc.bak" ]; then
|
||||
mv .nvmrc.bak .nvmrc
|
||||
fi
|
||||
|
||||
9
test/slow/nvm run/Running "nvm run 0.x" should work
Executable file
9
test/slow/nvm run/Running "nvm run 0.x" should work
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
[ "$(nvm run 0.10.7 --version | tail -1)" = "v0.10.7" ] || die "`nvm run` failed to run with the correct version"
|
||||
|
||||
13
test/slow/nvm run/Running "nvm run" should pick up .nvmrc version
Executable file
13
test/slow/nvm run/Running "nvm run" should pick up .nvmrc version
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../../nvm.sh
|
||||
|
||||
echo "0.10.7" > .nvmrc
|
||||
|
||||
[ "$(nvm run --version | tail -1)" = "v0.10.7" ] || die "\`nvm run\` failed to run with the .nvmrc version"
|
||||
|
||||
[ "$(nvm run --version | head -1)" = "Found '$PWD/.nvmrc' with version <0.10.7>" ] || die "\`nvm run\` failed to print out the \"found in .nvmrc\" message"
|
||||
|
||||
9
test/slow/nvm run/setup_dir
Executable file
9
test/slow/nvm run/setup_dir
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ../../../nvm.sh
|
||||
nvm install 0.10.7
|
||||
|
||||
if [ -f ".nvmrc" ]; then
|
||||
mv .nvmrc .nvmrc.bak
|
||||
fi
|
||||
|
||||
11
test/slow/nvm run/teardown_dir
Executable file
11
test/slow/nvm run/teardown_dir
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ../../../nvm.sh
|
||||
nvm uninstall v0.10.7
|
||||
|
||||
rm .nvmrc
|
||||
|
||||
if [ -f ".nvmrc.bak" ]; then
|
||||
mv .nvmrc.bak .nvmrc
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user