Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
200a9aa97e | ||
|
|
4512337c11 | ||
|
|
55677dba4a | ||
|
|
ca43ca21f5 | ||
|
|
fafbeb8c59 | ||
|
|
9c2127ce33 | ||
|
|
5ec0ccec1b | ||
|
|
7a423b7bb4 | ||
|
|
a3de7f3222 | ||
|
|
55d892adc8 | ||
|
|
3b42df8d1d | ||
|
|
21fa84225c |
7
Makefile
7
Makefile
@@ -20,6 +20,7 @@ endif
|
||||
|
||||
release: verify-tag
|
||||
@ OLD_TAG=`git describe --abbrev=0 --tags` && \
|
||||
npm version "$(TAG)" && \
|
||||
replace "$${OLD_TAG/v/}" "$(TAG)" -- nvm.sh install.sh README.markdown && \
|
||||
git commit --amend nvm.sh install.sh README.markdown package.json
|
||||
replace "$${OLD_TAG/v/}" "$(TAG)" -- nvm.sh install.sh README.markdown package.json && \
|
||||
git commit -m "v$(TAG)" nvm.sh install.sh README.markdown package.json && \
|
||||
git tag "v$(TAG)"
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ First you'll need to make sure your system has a c++ compiler. For OSX, XCode w
|
||||
|
||||
To install you could use the [install script][2] using cURL:
|
||||
|
||||
curl https://raw.githubusercontent.com/creationix/nvm/v0.11.0/install.sh | bash
|
||||
curl https://raw.githubusercontent.com/creationix/nvm/v0.11.2/install.sh | bash
|
||||
|
||||
or Wget:
|
||||
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.11.0/install.sh | bash
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.11.2/install.sh | bash
|
||||
|
||||
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc` or `~/.profile`).</sub>
|
||||
|
||||
@@ -163,7 +163,7 @@ 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.11.0/install.sh
|
||||
[2]: https://github.com/creationix/nvm/blob/v0.11.2/install.sh
|
||||
[3]: https://travis-ci.org/creationix/nvm
|
||||
[Urchin]: https://github.com/scraperwiki/urchin
|
||||
|
||||
|
||||
21
install.sh
21
install.sh
@@ -16,13 +16,12 @@ nvm_download() {
|
||||
curl $*
|
||||
elif nvm_has "wget"; then
|
||||
# Emulate curl with wget
|
||||
ARGS="$*"
|
||||
ARGS=${ARGS/--progress-bar /--progress=bar }
|
||||
ARGS=${ARGS/-L /}
|
||||
ARGS=${ARGS/-I /}
|
||||
ARGS=${ARGS/-s /-q }
|
||||
ARGS=${ARGS/-o /-O }
|
||||
ARGS=${ARGS/-C /-c }
|
||||
ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \
|
||||
-e 's/-L //' \
|
||||
-e 's/-I //' \
|
||||
-e 's/-s /-q /' \
|
||||
-e 's/-o /-O /' \
|
||||
-e 's/-C - /-c /')
|
||||
wget $ARGS
|
||||
fi
|
||||
}
|
||||
@@ -35,8 +34,8 @@ install_nvm_from_git() {
|
||||
if [ -d "$NVM_DIR/.git" ]; then
|
||||
echo "=> nvm is already installed in $NVM_DIR, trying to update"
|
||||
printf "\r=> "
|
||||
cd "$NVM_DIR" && (git pull 2> /dev/null || {
|
||||
echo >&2 "Failed to update nvm, run 'git pull' in $NVM_DIR yourself.." && exit 1
|
||||
cd "$NVM_DIR" && (git fetch 2> /dev/null || {
|
||||
echo >&2 "Failed to update nvm, run 'git fetch' in $NVM_DIR yourself." && exit 1
|
||||
})
|
||||
else
|
||||
# Cloning to $NVM_DIR
|
||||
@@ -45,12 +44,12 @@ install_nvm_from_git() {
|
||||
mkdir -p "$NVM_DIR"
|
||||
git clone "$NVM_SOURCE" "$NVM_DIR"
|
||||
fi
|
||||
git checkout v0.11.0
|
||||
cd $NVM_DIR && git checkout v0.11.2 && git branch -D master
|
||||
}
|
||||
|
||||
install_nvm_as_script() {
|
||||
if [ -z "$NVM_SOURCE" ]; then
|
||||
NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/v0.11.0/nvm.sh"
|
||||
NVM_SOURCE="https://raw.githubusercontent.com/creationix/nvm/v0.11.2/nvm.sh"
|
||||
fi
|
||||
|
||||
# Downloading to $NVM_DIR
|
||||
|
||||
22
nvm.sh
22
nvm.sh
@@ -17,13 +17,12 @@ nvm_download() {
|
||||
curl $*
|
||||
elif nvm_has "wget"; then
|
||||
# Emulate curl with wget
|
||||
ARGS="$*"
|
||||
ARGS=${ARGS/--progress-bar /--progress=bar }
|
||||
ARGS=${ARGS/-L /}
|
||||
ARGS=${ARGS/-I /}
|
||||
ARGS=${ARGS/-s /-q }
|
||||
ARGS=${ARGS/-o /-O }
|
||||
ARGS=${ARGS/-C /-c }
|
||||
ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \
|
||||
-e 's/-L //' \
|
||||
-e 's/-I //' \
|
||||
-e 's/-s /-q /' \
|
||||
-e 's/-o /-O /' \
|
||||
-e 's/-C - /-c /')
|
||||
wget $ARGS
|
||||
fi
|
||||
}
|
||||
@@ -93,6 +92,11 @@ nvm_version() {
|
||||
PATTERN='current'
|
||||
fi
|
||||
|
||||
if [ "$PATTERN" = "current" ]; then
|
||||
nvm_ls_current
|
||||
return $?
|
||||
fi
|
||||
|
||||
VERSION=`nvm_ls $PATTERN | tail -n1`
|
||||
echo "$VERSION"
|
||||
|
||||
@@ -318,7 +322,7 @@ nvm() {
|
||||
version_not_provided=0
|
||||
local provided_version
|
||||
|
||||
if ! nvm_has "nvm_download"; then
|
||||
if ! nvm_has "curl" && ! nvm_has "wget"; then
|
||||
echo 'nvm needs curl or wget to proceed.' >&2;
|
||||
return 1
|
||||
fi
|
||||
@@ -683,7 +687,7 @@ nvm() {
|
||||
nvm_version $2
|
||||
;;
|
||||
"--version" )
|
||||
echo "0.11.0"
|
||||
echo "0.11.2"
|
||||
;;
|
||||
"unload" )
|
||||
unset -f nvm nvm_print_versions nvm_checksum nvm_ls_remote nvm_ls nvm_remote_version nvm_version nvm_rc_version > /dev/null 2>&1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nvm",
|
||||
"version": "0.11.0",
|
||||
"version": "0.11.2",
|
||||
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
|
||||
10
test/slow/Running "nvm current" should display current nvm environment.
Executable file
10
test/slow/Running "nvm current" should display current nvm environment.
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
die () { echo $@ ; exit 1; }
|
||||
|
||||
. ../../nvm.sh
|
||||
|
||||
nvm install 0.10
|
||||
|
||||
[ "$(nvm current)" = "$(node -v)" ] || die "Failed to find current version: got \"$(nvm current)\", expected \"$(node -v)\""
|
||||
|
||||
Reference in New Issue
Block a user