mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-04-17 04:29:14 +02:00
Create npm completion on first run
This commit is contained in:
parent
bd6dbd1d9b
commit
69c18453de
2 changed files with 10 additions and 1 deletions
1
plugins/npm/.gitignore
vendored
Normal file
1
plugins/npm/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
npm_completion
|
||||
|
|
@ -1,4 +1,12 @@
|
|||
eval "$(npm completion 2>/dev/null)"
|
||||
__NPM_COMPLETION_DIR="${0:A:h}"
|
||||
__NPM_COMPLETION_FILE="${__NPM_COMPLETION_DIR}/npm_completion"
|
||||
|
||||
if [[ ! -f $__NPM_COMPLETION_FILE ]]; then
|
||||
npm completion > $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE
|
||||
compinit -i -d "${ZSH_COMPDUMP}"
|
||||
fi
|
||||
|
||||
source $__NPM_COMPLETION_FILE
|
||||
|
||||
# Install dependencies globally
|
||||
alias npmg="npm i -g "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue