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

Optimize activate #128

Merged
merged 1 commit into from
Jul 8, 2013
Merged

Optimize activate #128

merged 1 commit into from
Jul 8, 2013

Conversation

SamiHostikka
Copy link
Contributor

Currently activate() copies activated version even if it is already in use:

$ for((i=0; i < 3; i++))
> do
> sudo n $(node --version|cut -c2-)
> ls --full-time $(which node)
> done
/usr/local/bin/node
-rwxr-xr-x 1 root root 9018962 2013-07-07 14:38:38.651703976 +0000 /usr/local/bin/node
/usr/local/bin/node
-rwxr-xr-x 1 root root 9018962 2013-07-07 14:38:41.321037976 +0000 /usr/local/bin/node
/usr/local/bin/node
-rwxr-xr-x 1 root root 9018962 2013-07-07 14:38:42.837795976 +0000 /usr/local/bin/node

With fix:

$ for((i=0; i < 3; i++))
> do
> sudo n $(node --version|cut -c2-)
> ls --full-time $(which node)
> done
/usr/local/bin/node
-rwxr-xr-x 1 root root 9018962 2013-07-07 14:38:42.837795976 +0000 /usr/local/bin/node
/usr/local/bin/node
-rwxr-xr-x 1 root root 9018962 2013-07-07 14:38:42.837795976 +0000 /usr/local/bin/node
/usr/local/bin/node
-rwxr-xr-x 1 root root 9018962 2013-07-07 14:38:42.837795976 +0000 /usr/local/bin/node

@jeromedecoster
Copy link
Contributor

+1
If the version we want to activate is already the current version, do nothing !
It currently update the .prev file and copy the node directory content

tj added a commit that referenced this pull request Jul 8, 2013
@tj tj merged commit 7f84472 into tj:master Jul 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants