6cc4389304c02cefe1501e5df18baaae56741447
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #319 from sorin-ionescu/plugin-npm
Replace npm 0.x completion with 1.0 completion.
Diff
1diff --git a/plugins/npm/_npm b/plugins/npm/_npm
2deleted file mode 100644
3index 24b536188e08a12e9422fef49c16409b478d329c..0000000000000000000000000000000000000000
4--- a/plugins/npm/_npm
5+++ /dev/null
6@@ -1,19 +0,0 @@
7-#compdef npm
8-
9-# Node Package Manager 0.3.15 completion, letting npm do all the completion work
10-
11-_npm() {
12- compadd -- $(_npm_complete $words)
13-}
14-
15-# We want to show all errors of any substance, but never the "npm (not )ok" one.
16-# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.)
17-_npm_complete() {
18- local ask_npm
19- ask_npm=(npm completion --color false --loglevel error -- $@)
20- { _call_program npm $ask_npm 2>&1 >&3 \
21- | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \
22- } 3>&1
23-}
24-
25-_npm "$@"
26diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh
27new file mode 100644
28index 0000000000000000000000000000000000000000..c3eb91d313204a3ca5ca084e24327254ff8e6ffa
29--- /dev/null
30+++ b/plugins/npm/npm.plugin.zsh
31@@ -0,0 +1 @@
32+eval "$(npm completion 2>/dev/null)"