Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #128 from hstkk/activate

Optimize activate
  • Loading branch information...
commit 7f8447281a0b3d27fafc99116495650fc11733f6 2 parents 4185193 + 89fda52
@tj authored
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
}
#
Please sign in to comment.
Something went wrong with that request. Please try again.