Permalink
Browse files

Merge pull request #128 from hstkk/activate

Optimize activate
  • Loading branch information...
2 parents 4185193 + 89fda52 commit 7f8447281a0b3d27fafc99116495650fc11733f6 @tj committed Jul 8, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 bin/n
View
8 bin/n
@@ -240,10 +240,12 @@ tarball_url() {
activate() {
local version=$1
- local dir=$VERSIONS_DIR/$version
check_current_version
- echo $active > $VERSIONS_DIR/.prev
- cp -fR $dir/* $N_PREFIX
+ if [ "$version" != "$active" ]; then
+ local dir=$VERSIONS_DIR/$version
+ echo $active > $VERSIONS_DIR/.prev
+ cp -fR $dir/* $N_PREFIX
+ fi
}
#

0 comments on commit 7f84472

Please sign in to comment.