Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cli.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-12-13 00:16:30 +0300
committerisaacs <i@izs.me>2010-12-13 00:25:07 +0300
commit9d1ff59bff2b81c430dbb22267603bf8d9531b8e (patch)
treeffbbed7386435dc6dd36744ae7f86b5a448f5a77 /cli.js
parent5aba569990639596113509727ede6cc1ac166994 (diff)
Warnings and pointers for homebrew users.
Warn if Cellar paths detected in __filename or execPath. Echo a warning whenever bins/modules/man pages are installed to someplace where they are unlikely to be found.
Diffstat (limited to 'cli.js')
-rwxr-xr-xcli.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/cli.js b/cli.js
index 5a91e3596..013a3446c 100755
--- a/cli.js
+++ b/cli.js
@@ -1,11 +1,18 @@
#!/usr/bin/env node
;(function () { // wrapper in case we're in module_context mode
-// don't assume that npm is installed in any particular spot, since this
-// might conceivably be a bootstrap attempt.
var log = require("./lib/utils/log")
log.waitForConfig()
log.info("ok", "it worked if it ends with")
+if (__filename.match(/Cellar\/npm\/[^\/]+\/libexec\/cli.js$/)
+ ||process.execPath.match(/Cellar\/node\/[^\/]+\/bin\/node$/) {
+ log.warn("This program is not compatible with Homebrew."
+ +"\n brew rm npm ; brew rm node"
+ +"\nThen use one of the techniques in this gist instead:"
+ +"\nhttps://gist.github.com/579814", "brew incompatible")
+}
+
+
var fs = require("./lib/utils/graceful-fs")
, path = require("path")
, sys = require("./lib/utils/sys")