Skip to content

Commit

Permalink
Merge pull request tj#85 from Suor/master
Browse files Browse the repository at this point in the history
Use symlinks instead of copying files upon switch
  • Loading branch information
tj committed Sep 30, 2012
2 parents a5593eb + 0895ea3 commit 77946bb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bin/n
Expand Up @@ -138,12 +138,11 @@ install_node() {
# activate
local dir=$VERSIONS_DIR/$version
if test -d $dir; then
# TODO: refactor, this is lame
cd $dir \
&& mkdir -p $N_PREFIX/lib/node \
&& cp -fR $dir/include/node $N_PREFIX/include \
&& cp -fR $dir/bin/* $N_PREFIX/bin \
&& cp -fR $dir/lib/node/* $N_PREFIX/lib/node/ .
# symlink everything, purge old copies or symlinks
for d in bin lib share include; do
rm -rf $N_PREFIX/$d
ln -s $dir/$d $N_PREFIX/$d
done
# install
else
local tarball="node-v$version.tar.gz"
Expand Down

0 comments on commit 77946bb

Please sign in to comment.