summaryrefslogtreecommitdiff
path: root/deps/npm/lib/run-script.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/run-script.js')
-rw-r--r--deps/npm/lib/run-script.js27
1 files changed, 2 insertions, 25 deletions
diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js
index bf72bf814..057af2bc6 100644
--- a/deps/npm/lib/run-script.js
+++ b/deps/npm/lib/run-script.js
@@ -13,7 +13,6 @@ runScript.completion = function (opts, cb) {
// see if there's already a package specified.
var argv = opts.conf.argv.remain
- , installedShallow = require("./utils/completion/installed-shallow.js")
if (argv.length >= 4) return cb()
@@ -41,33 +40,11 @@ runScript.completion = function (opts, cb) {
})
}
- // complete against the installed-shallow, and the pwd's scripts.
- // but only packages that have scripts
- var installed
- , scripts
- installedShallow(opts, function (d) {
- return d.scripts
- }, function (er, inst) {
- installed = inst
- next()
- })
-
- if (npm.config.get("global")) {
- scripts = []
- next()
- }
- else readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
+ readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
d = d || {}
- scripts = Object.keys(d.scripts || {})
- next()
+ cb(null, Object.keys(d.scripts || {}))
})
-
- function next () {
- if (!installed || !scripts) return
-
- cb(null, scripts.concat(installed))
- }
}
function runScript (args, cb) {