Skip to content

Commit

Permalink
Use symlinks instead of copying files upon switch.
Browse files Browse the repository at this point in the history
Bakward incompatable change - any modules and executables
such as npm, coffee and even n itself are now diffrent
for diffrent node versions. This is probably a good thing anyway.
  • Loading branch information
Suor committed Sep 30, 2012
1 parent a5593eb commit 0895ea3
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 0895ea3

Please sign in to comment.