Under certain network environments, due to poor implementation of file
download caches (immoral Chinese ISP), the direct download of Node.js
packages (http://nodejs.org/dist/node-$VERSION.tar.gz) will be
redirected to alternative urls using 302 redirections, which are not
handled by `curl --process-bar` by default. Instead, curl will "fail"
silently without creating any output file or error exitcode.
(Tested under Ubuntu 12.04 Desktop)
Fixed by adding "-L" switches to the curl commands responsible for
downloading the binary and source node.js packages.
The same fix as #207, just for fools like me who have `which` aliased to `type` in OS X. Without this escape, a very cryptic error message is emitted (though the install ultimately succeeds, as long as one actually has `curl` installed).
Fixes issues #232 and #244 where "nvm ls" returns inconsistent results depending on the number of node versions installed. This updated fix uses the find and sort commands only. Tested in bash v3.2.48 and v4.2.25, and zsh v4.3.11.
Fixes issue 232 that occurs in at least bash v4.2.25 where "nvm ls" returns "N/A" no matter how many versions of node have been installed. The fix uses a combination of the find, tr and basename commands instead of basename only. Tested in bash v3.2.48 and v4.2.25 and zsh v4.3.11.
basename doesn't accept options in bash. This causes the VERSIONS variable get the 'N/A' value for $ nvm ls command.
From basename man page:
NAME
basename - strip directory and suffix from filenames
SYNOPSIS
basename NAME [SUFFIX]
basename OPTION
DESCRIPTION
Print NAME with any leading directory components removed. If specified, also remove a trailing SUFFIX.
--help display this help and exit
--version
output version information and exit
coreutils version used in Linux Mint 14 Nadia.
GNU coreutils 8.12.197-032bb September 2011 BASENAME(1)
No idea if this flag exists on FreeBSD or other unixes (if they use gnu coreutils shouldn't be any problem)
Since we run in interactive context the builtin `cd' may have been aliased to
print some additional info when invoked, thus it's safer for us to avoid
parsing the output from subshells which calls it.
For instance in .bash_profile I have the following function to redefine
`cd' such that it will list the destination directory contents:
cd () { builtin cd "$@" && ls -F --color=auto }
line 188, `which shasum > /dev/null 2>&1` will be replaced by:
'/usr/bin/shasum > /dev/null 2>&1'
but, `/usr/bin/shasum` needs filename argument which is ommited and the
test results always 'false'.