Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a symlink in .nvm to the current version. #467

Merged
merged 1 commit into from
Jul 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ test/bak
node_modules/

.DS_Store

current
1 change: 1 addition & 0 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ nvm() {
export NODE_PATH
export NVM_PATH="$NVM_DIR/$VERSION/lib/node"
export NVM_BIN="$NVM_DIR/$VERSION/bin"
rm -f "$NVM_DIR/current" && ln -s "$NVM_DIR/$VERSION" "$NVM_DIR/current"
echo "Now using node $VERSION"
;;
"run" )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

. ../../nvm.sh

rm -rf ../../v0.10.29
mkdir ../../v0.10.29
nvm use 0.10.29

if [ ! -L ../../current ];then
echo "Expected 'current' symlink to be created!"
exit 1
fi

oldLink="$(readlink ../../current)"

if [ "$(basename $oldLink)" != 'v0.10.29' ];then
echo "Expected 'current' to point to v0.10.29 but was $oldLink"
exit 1
fi

rm -rf ../../v0.11.13
mkdir ../../v0.11.13
nvm use 0.11.13

newLink="$(readlink ../../current)"

if [ "$(basename $newLink)" != 'v0.11.13' ];then
echo "Expected 'current' to point to v0.11.13 but was $newLink"
exit 1
fi