Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25fa40e7cb | ||
|
|
6abc36ee4f | ||
|
|
68bf93514b | ||
|
|
7e18328a88 | ||
|
|
85c5e12710 | ||
|
|
d0180f7eb2 | ||
|
|
5ba6e748b7 |
@@ -3,18 +3,25 @@ addons:
|
||||
apt_packages:
|
||||
- zsh
|
||||
- ksh
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.stack
|
||||
before_install:
|
||||
- $SHELL --version 2> /dev/null || dpkg -s $SHELL 2> /dev/null || which $SHELL
|
||||
- curl --version
|
||||
- wget --version
|
||||
- if [ -n "${SHELLCHECK-}" ]; then sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 575159689BEFB442 && echo 'deb http://download.fpcomplete.com/ubuntu precise main' | sudo tee /etc/apt/sources.list.d/fpco.list && sudo apt-get update && sudo apt-get install stack bc -y && stack setup && stack install ShellCheck && shellcheck --version ; fi
|
||||
install:
|
||||
- (mkdir /tmp/urchin && cd /tmp/urchin && curl -s "$(curl -s https://registry.npmjs.com/urchin | grep -Eo '"tarball":\s*"[^"]+"' | tail -n 1 | awk -F\" '{ print $4 }')" -O && tar -x -f urchin*)
|
||||
- chmod +x /tmp/urchin/package/urchin
|
||||
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
|
||||
script:
|
||||
- export PATH=$(echo $PATH | sed 's/::/:/')
|
||||
- NVM_DIR=$TRAVIS_BUILD_DIR make TEST_SUITE=$TEST_SUITE URCHIN=/tmp/urchin/package/urchin test-$SHELL
|
||||
- export NVM_DIR="${TRAVIS_BUILD_DIR}"
|
||||
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh && shellcheck -s bash install.sh ; fi
|
||||
- if [ -z "${SHELLCHECK-}" ]; then make TEST_SUITE=$TEST_SUITE URCHIN=/tmp/urchin/package/urchin test-$SHELL ; fi
|
||||
env:
|
||||
- SHELLCHECK=true
|
||||
- SHELL=bash TEST_SUITE=install_script
|
||||
- SHELL=sh TEST_SUITE=fast
|
||||
- SHELL=dash TEST_SUITE=fast
|
||||
|
||||
@@ -37,13 +37,13 @@ Note: If you're using `zsh` you can easily install `nvm` as a zsh plugin. Instal
|
||||
To install or update nvm, you can use the [install script][2] using cURL:
|
||||
|
||||
```sh
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash
|
||||
```
|
||||
|
||||
or Wget:
|
||||
|
||||
```sh
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash
|
||||
```
|
||||
|
||||
<sub>The script clones the nvm repository to `~/.nvm` and adds the source line to your profile (`~/.bash_profile`, `~/.zshrc`, `~/.profile`, or `~/.bashrc`).</sub>
|
||||
@@ -404,7 +404,7 @@ If installing nvm on Alpine Linux *is* still what you want or need to do, you sh
|
||||
|
||||
```sh
|
||||
apk add bash
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | /bin/bash
|
||||
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | /bin/bash
|
||||
```
|
||||
|
||||
The Node project has some desire but no concrete plans (due to the overheads of building, testing and support) to offer Alpine-compatible binaries.
|
||||
@@ -435,7 +435,7 @@ After the v0.8.6 release of node, nvm tries to install from binary packages. But
|
||||
If setting the `default` alias does not establish the node version in new shells (i.e. `nvm current` yields `system`), ensure that the system's node PATH is set before the `nvm.sh` source line in your shell profile (see [#658](https://github.com/creationix/nvm/issues/658))
|
||||
|
||||
[1]: https://github.com/creationix/nvm.git
|
||||
[2]: https://github.com/creationix/nvm/blob/v0.31.6/install.sh
|
||||
[2]: https://github.com/creationix/nvm/blob/v0.31.7/install.sh
|
||||
[3]: https://travis-ci.org/creationix/nvm
|
||||
[Urchin]: https://github.com/scraperwiki/urchin
|
||||
[Fish]: http://fishshell.com
|
||||
|
||||
46
install.sh
46
install.sh
@@ -11,7 +11,7 @@ nvm_install_dir() {
|
||||
}
|
||||
|
||||
nvm_latest_version() {
|
||||
echo "v0.31.6"
|
||||
echo "v0.31.7"
|
||||
}
|
||||
|
||||
#
|
||||
@@ -78,13 +78,29 @@ install_nvm_from_git() {
|
||||
# Cloning to $INSTALL_DIR
|
||||
echo "=> Downloading nvm from git to '$INSTALL_DIR'"
|
||||
command printf "\r=> "
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
command git clone "$(nvm_source)" "$INSTALL_DIR" || {
|
||||
echo >&2 "Failed to clone nvm repo. Please report this!"
|
||||
exit 1
|
||||
}
|
||||
mkdir -p "${INSTALL_DIR}"
|
||||
if [ "$(ls -A "${INSTALL_DIR}")" ]; then
|
||||
command git init "${INSTALL_DIR}" || {
|
||||
echo >&2 'Failed to initialize nvm repo. Please report this!'
|
||||
exit 2
|
||||
}
|
||||
command git --git-dir="${INSTALL_DIR}/.git" remote add origin "$(nvm_source)" 2> /dev/null \
|
||||
|| command git --git-dir="${INSTALL_DIR}/.git" remote set-url origin "$(nvm_source)" || {
|
||||
echo >&2 'Failed to add remote "origin" (or set the URL). Please report this!'
|
||||
exit 2
|
||||
}
|
||||
command git --git-dir="${INSTALL_DIR}/.git" fetch origin --tags || {
|
||||
echo >&2 'Failed to fetch origin with tags. Please report this!'
|
||||
exit 2
|
||||
}
|
||||
else
|
||||
command git clone "$(nvm_source)" "${INSTALL_DIR}" || {
|
||||
echo >&2 'Failed to clone nvm repo. Please report this!'
|
||||
exit 2
|
||||
}
|
||||
fi
|
||||
fi
|
||||
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout --quiet "$(nvm_latest_version)"
|
||||
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" checkout -f --quiet "$(nvm_latest_version)"
|
||||
if [ ! -z "$(command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" show-ref refs/heads/master)" ]; then
|
||||
if command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet 2>/dev/null; then
|
||||
command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" branch --quiet -D master >/dev/null 2>&1
|
||||
@@ -240,24 +256,24 @@ nvm_check_global_modules() {
|
||||
}
|
||||
|
||||
nvm_do_install() {
|
||||
if [ -z "$METHOD" ]; then
|
||||
if [ -z "${METHOD}" ]; then
|
||||
# Autodetect install method
|
||||
if nvm_has "git"; then
|
||||
if nvm_has git; then
|
||||
install_nvm_from_git
|
||||
elif nvm_has "nvm_download"; then
|
||||
elif nvm_has nvm_download; then
|
||||
install_nvm_as_script
|
||||
else
|
||||
echo >&2 "You need git, curl, or wget to install nvm"
|
||||
echo >&2 'You need git, curl, or wget to install nvm'
|
||||
exit 1
|
||||
fi
|
||||
elif [ "~$METHOD" = "~git" ]; then
|
||||
if ! nvm_has "git"; then
|
||||
elif [ "${METHOD}" = 'git' ]; then
|
||||
if ! nvm_has git; then
|
||||
echo >&2 "You need git to install nvm"
|
||||
exit 1
|
||||
fi
|
||||
install_nvm_from_git
|
||||
elif [ "~$METHOD" = "~script" ]; then
|
||||
if ! nvm_has "nvm_download"; then
|
||||
elif [ "${METHOD}" = 'script' ]; then
|
||||
if ! nvm_has nvm_download; then
|
||||
echo >&2 "You need curl or wget to install nvm"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
3
nvm.sh
3
nvm.sh
@@ -966,6 +966,7 @@ nvm_ls_remote_index_tab() {
|
||||
)"
|
||||
local LTS_ALIAS
|
||||
local LTS_VERSION
|
||||
command mkdir -p "$(nvm_alias_path)/lts"
|
||||
nvm_echo "${VERSION_LIST}" \
|
||||
| awk '{
|
||||
if ($10 ~ /^\-?$/) { next }
|
||||
@@ -2919,7 +2920,7 @@ $NVM_LS_REMOTE_POST_MERGED_OUTPUT" | nvm_grep -v "N/A" | command sed '/^$/d')"
|
||||
NVM_VERSION_ONLY=true NVM_LTS="${NVM_LTS-}" nvm_remote_version "${PATTERN:-node}"
|
||||
;;
|
||||
"--version" )
|
||||
nvm_echo '0.31.6'
|
||||
nvm_echo '0.31.7'
|
||||
;;
|
||||
"unload" )
|
||||
unset -f nvm nvm_print_versions nvm_checksum \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nvm",
|
||||
"version": "0.31.6",
|
||||
"version": "0.31.7",
|
||||
"description": "Node Version Manager - Simple bash script to manage multiple active node.js versions",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
|
||||
Reference in New Issue
Block a user