Remove support for sync latest and stable. I never liked them. Fork if you want them

Change-Id: I9092c5625305f54212625af0c16f7ead73a3d9fa
master
Tim Caswell 2011-09-28 10:56:16 -07:00
parent 273aeeee73
commit ac9a52886d
1 changed files with 3 additions and 31 deletions

34
nvm.sh
View File

@ -45,12 +45,6 @@ nvm_version()
if [ ! "$PATTERN" -o "$PATTERN" = 'current' ]; then if [ ! "$PATTERN" -o "$PATTERN" = 'current' ]; then
VERSION=`node -v 2>/dev/null` VERSION=`node -v 2>/dev/null`
fi fi
if [ "$PATTERN" = 'stable' ]; then
PATTERN='*.*[02468].'
fi
if [ "$PATTERN" = 'latest' ]; then
PATTERN='*.*.'
fi
if [ "$PATTERN" = 'all' ]; then if [ "$PATTERN" = 'all' ]; then
(cd $NVM_DIR; \ls -dG v* 2>/dev/null || echo "N/A") (cd $NVM_DIR; \ls -dG v* 2>/dev/null || echo "N/A")
return return
@ -84,21 +78,18 @@ nvm()
echo " nvm install <version> Download and install a <version>" echo " nvm install <version> Download and install a <version>"
echo " nvm uninstall <version> Uninstall a version" echo " nvm uninstall <version> Uninstall a version"
echo " nvm use <version> Modify PATH to use <version>" echo " nvm use <version> Modify PATH to use <version>"
echo " nvm ls List versions (installed versions are blue)" echo " nvm ls List installed versions"
echo " nvm ls <version> List versions matching a given description" echo " nvm ls <version> List versions matching a given description"
echo " nvm deactivate Undo effects of NVM on current shell" echo " nvm deactivate Undo effects of NVM on current shell"
echo " nvm sync Update the local cache of available versions"
echo " nvm alias [<pattern>] Show all aliases beginning with <pattern>" echo " nvm alias [<pattern>] Show all aliases beginning with <pattern>"
echo " nvm alias <name> <version> Set an alias named <name> pointing to <version>" echo " nvm alias <name> <version> Set an alias named <name> pointing to <version>"
echo " nvm unalias <name> Deletes the alias named <name>" echo " nvm unalias <name> Deletes the alias named <name>"
echo " nvm copy-packages <version> Install global NPM packages contained in <version> to current version" echo " nvm copy-packages <version> Install global NPM packages contained in <version> to current version"
echo echo
echo "Example:" echo "Example:"
echo " nvm install v0.4.0 Install a specific version number" echo " nvm install v0.4.12 Install a specific version number"
echo " nvm use stable Use the stable release"
echo " nvm install latest Install the latest, possibly unstable version"
echo " nvm use 0.2 Use the latest available 0.2.x release" echo " nvm use 0.2 Use the latest available 0.2.x release"
echo " nvm alias default v0.4.0 Set v0.4.0 as the default" echo " nvm alias default 0.4 Auto use the latest installed v0.4.x version"
echo echo
;; ;;
"install" ) "install" )
@ -166,8 +157,6 @@ nvm()
nvm unalias `basename $A` nvm unalias `basename $A`
done done
# Run sync in order to restore version stub file in $NVM_DIR.
nvm sync 1>/dev/null
;; ;;
"deactivate" ) "deactivate" )
if [[ $PATH == *$NVM_DIR/*/bin* ]]; then if [[ $PATH == *$NVM_DIR/*/bin* ]]; then
@ -221,7 +210,6 @@ nvm()
echo -ne "$P: \t"; nvm_version $P echo -ne "$P: \t"; nvm_version $P
done done
nvm alias nvm alias
echo "# use 'nvm sync' to update from nodejs.org"
;; ;;
"alias" ) "alias" )
mkdir -p $NVM_DIR/alias mkdir -p $NVM_DIR/alias
@ -250,7 +238,6 @@ nvm()
echo $3 > "$NVM_DIR/alias/$2" echo $3 > "$NVM_DIR/alias/$2"
if [ ! "$3" = "$VERSION" ]; then if [ ! "$3" = "$VERSION" ]; then
echo "$2 -> $3 (-> $VERSION)" echo "$2 -> $3 (-> $VERSION)"
echo "! WARNING: Moving target. Aliases to implicit versions may change without warning."
else else
echo "$2 -> $3" echo "$2 -> $3"
fi fi
@ -262,21 +249,6 @@ nvm()
rm -f $NVM_DIR/alias/$2 rm -f $NVM_DIR/alias/$2
echo "Deleted alias $2" echo "Deleted alias $2"
;; ;;
"sync" )
[ "$NOCURL" ] && curl && return
LATEST=`nvm_version latest`
STABLE=`nvm_version stable`
(cd $NVM_DIR
rm -f v* 2>/dev/null
printf "# syncing with nodejs.org..."
for VER in `curl -s http://nodejs.org/dist/ -o - | grep 'v[0-9].*' | sed -e 's/.*node-//' -e 's/\.tar\.gz.*//' -e 's/<[^>]*>//' -e 's/\/<[^>]*>.*//'`; do
touch $VER
done
echo " done."
)
[ "$STABLE" = `nvm_version stable` ] || echo "NEW stable: `nvm_version stable`"
[ "$LATEST" = `nvm_version latest` ] || echo "NEW latest: `nvm_version latest`"
;;
"copy-packages" ) "copy-packages" )
if [ $# -ne 2 ]; then if [ $# -ne 2 ]; then
nvm help nvm help