Compare commits

...

12 Commits

Author SHA1 Message Date
Jordan Harband
200a9aa97e v0.11.2 2014-07-20 23:58:19 -07:00
Jordan Harband
4512337c11 Adding a slow nvm current test, since it needs an installed version of node. 2014-07-20 23:41:11 -07:00
Jordan Harband
55677dba4a Avoid calling "nvm_ls current" and call "nvm_ls_current" directly 2014-07-20 23:40:20 -07:00
Jordan Harband
ca43ca21f5 Fix curl/wget detection. Fixes #478 2014-07-18 13:18:09 -07:00
Jordan Harband
fafbeb8c59 Merge pull request #479 from koenpunt/fix-args-replacement
string replacement turns out not POSIX compliant
2014-07-18 13:15:13 -07:00
Koen Punt
9c2127ce33 string replacement turns out not POSIX compliant 2014-07-18 16:21:20 +02:00
Jordan Harband
5ec0ccec1b Fixing make release to also cover package.json.
Per a3de7f3222 (commitcomment-7057689)
2014-07-18 01:49:57 -07:00
Jordan Harband
7a423b7bb4 v0.11.1 2014-07-18 01:48:46 -07:00
Jordan Harband
a3de7f3222 Fixing make release - amending a tagged commit makes the commit not match the tag. 2014-07-17 00:25:14 -07:00
Jordan Harband
55d892adc8 Fix #476 by making sure to cd into $NVM_DIR before checking out the tag. Also delete the master branch, because we won't be needing that. 2014-07-17 00:20:33 -07:00
Jordan Harband
3b42df8d1d Merge pull request #474 from mzgol/wget-hotfix
Hotfix: correctly map curl's `-C -` to wget
2014-07-16 10:16:18 -07:00
Michał Gołębiowski
21fa84225c Hotfix: correctly map curl's -C - to wget
wget doesn't need or accept the `-` parameter to `-c`. This incorrect
mapping causes `nvm install` to fail on a curlless OS.
2014-07-16 11:00:56 +02:00
6 changed files with 41 additions and 27 deletions

View File

@@ -20,6 +20,7 @@ endif
release: verify-tag release: verify-tag
@ OLD_TAG=`git describe --abbrev=0 --tags` && \ @ OLD_TAG=`git describe --abbrev=0 --tags` && \
npm version "$(TAG)" && \ replace "$${OLD_TAG/v/}" "$(TAG)" -- nvm.sh install.sh README.markdown package.json && \
replace "$${OLD_TAG/v/}" "$(TAG)" -- nvm.sh install.sh README.markdown && \ git commit -m "v$(TAG)" nvm.sh install.sh README.markdown package.json && \
git commit --amend nvm.sh install.sh README.markdown package.json git tag "v$(TAG)"

View File

@@ -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: 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: 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> <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 nvm install -s 0.8.6
[1]: https://github.com/creationix/nvm.git [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 [3]: https://travis-ci.org/creationix/nvm
[Urchin]: https://github.com/scraperwiki/urchin [Urchin]: https://github.com/scraperwiki/urchin

View File

@@ -16,13 +16,12 @@ nvm_download() {
curl $* curl $*
elif nvm_has "wget"; then elif nvm_has "wget"; then
# Emulate curl with wget # Emulate curl with wget
ARGS="$*" ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \
ARGS=${ARGS/--progress-bar /--progress=bar } -e 's/-L //' \
ARGS=${ARGS/-L /} -e 's/-I //' \
ARGS=${ARGS/-I /} -e 's/-s /-q /' \
ARGS=${ARGS/-s /-q } -e 's/-o /-O /' \
ARGS=${ARGS/-o /-O } -e 's/-C - /-c /')
ARGS=${ARGS/-C /-c }
wget $ARGS wget $ARGS
fi fi
} }
@@ -35,8 +34,8 @@ install_nvm_from_git() {
if [ -d "$NVM_DIR/.git" ]; then if [ -d "$NVM_DIR/.git" ]; then
echo "=> nvm is already installed in $NVM_DIR, trying to update" echo "=> nvm is already installed in $NVM_DIR, trying to update"
printf "\r=> " printf "\r=> "
cd "$NVM_DIR" && (git pull 2> /dev/null || { cd "$NVM_DIR" && (git fetch 2> /dev/null || {
echo >&2 "Failed to update nvm, run 'git pull' in $NVM_DIR yourself.." && exit 1 echo >&2 "Failed to update nvm, run 'git fetch' in $NVM_DIR yourself." && exit 1
}) })
else else
# Cloning to $NVM_DIR # Cloning to $NVM_DIR
@@ -45,12 +44,12 @@ install_nvm_from_git() {
mkdir -p "$NVM_DIR" mkdir -p "$NVM_DIR"
git clone "$NVM_SOURCE" "$NVM_DIR" git clone "$NVM_SOURCE" "$NVM_DIR"
fi fi
git checkout v0.11.0 cd $NVM_DIR && git checkout v0.11.2 && git branch -D master
} }
install_nvm_as_script() { install_nvm_as_script() {
if [ -z "$NVM_SOURCE" ]; then 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 fi
# Downloading to $NVM_DIR # Downloading to $NVM_DIR

22
nvm.sh
View File

@@ -17,13 +17,12 @@ nvm_download() {
curl $* curl $*
elif nvm_has "wget"; then elif nvm_has "wget"; then
# Emulate curl with wget # Emulate curl with wget
ARGS="$*" ARGS=$(echo "$*" | sed -e 's/--progress-bar /--progress=bar /' \
ARGS=${ARGS/--progress-bar /--progress=bar } -e 's/-L //' \
ARGS=${ARGS/-L /} -e 's/-I //' \
ARGS=${ARGS/-I /} -e 's/-s /-q /' \
ARGS=${ARGS/-s /-q } -e 's/-o /-O /' \
ARGS=${ARGS/-o /-O } -e 's/-C - /-c /')
ARGS=${ARGS/-C /-c }
wget $ARGS wget $ARGS
fi fi
} }
@@ -93,6 +92,11 @@ nvm_version() {
PATTERN='current' PATTERN='current'
fi fi
if [ "$PATTERN" = "current" ]; then
nvm_ls_current
return $?
fi
VERSION=`nvm_ls $PATTERN | tail -n1` VERSION=`nvm_ls $PATTERN | tail -n1`
echo "$VERSION" echo "$VERSION"
@@ -318,7 +322,7 @@ nvm() {
version_not_provided=0 version_not_provided=0
local provided_version 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; echo 'nvm needs curl or wget to proceed.' >&2;
return 1 return 1
fi fi
@@ -683,7 +687,7 @@ nvm() {
nvm_version $2 nvm_version $2
;; ;;
"--version" ) "--version" )
echo "0.11.0" echo "0.11.2"
;; ;;
"unload" ) "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 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

View File

@@ -1,6 +1,6 @@
{ {
"name": "nvm", "name": "nvm",
"version": "0.11.0", "version": "0.11.2",
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions", "description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
"directories": { "directories": {
"test": "test" "test": "test"

View 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)\""