Browse Source

build: Don't clobber symlinked npm

v0.9.1-release
isaacs 13 years ago
parent
commit
cc36cc5999
  1. 11
      tools/installer.js

11
tools/installer.js

@ -126,6 +126,16 @@ if (cmd === 'install') {
// Install npm (eventually)
if (variables.node_install_npm) {
// Frequently, in development, the installed npm is a symbolic
// link to the development folder, and so installing this is
// a bit annoying. If it's a symlink, skip it.
var isSymlink = false;
try {
var st = fs.lstatSync(path.resolve(node_prefix, 'lib/node_modules/npm'));
isSymlink = st.isSymbolicLink();
} catch (e) {}
if (!isSymlink) {
copy('deps/npm', 'lib/node_modules/npm');
queue.push('ln -sf ../lib/node_modules/npm/bin/npm-cli.js ' +
path.join(dest_dir, node_prefix, 'bin/npm'));
@ -133,6 +143,7 @@ if (cmd === 'install') {
path.join(dest_dir, node_prefix,
'lib/node_modules/npm/bin/npm-cli.js')]);
}
}
} else {
remove([
'bin/node', 'bin/npm', 'bin/node-waf',

Loading…
Cancel
Save