From 2a44527ac3eea1e87b518f69956f3a2bde669dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 10 Sep 2016 00:21:11 +0200 Subject: [PATCH 1/3] npm: quiet error output of npm completion --- plugins/npm/npm.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index 30b91ec9c..fd2703ce1 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -2,7 +2,8 @@ __NPM_COMPLETION_FILE="${ZSH_CACHE_DIR}/npm_completion" if [[ ! -f $__NPM_COMPLETION_FILE ]]; then - npm completion >! $__NPM_COMPLETION_FILE || rm -f $__NPM_COMPLETION_FILE + npm completion >! $__NPM_COMPLETION_FILE 2>/dev/null + [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE fi source $__NPM_COMPLETION_FILE From 76924b7f5fbcfc808b00c76df13dd176a46cda6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 10 Sep 2016 00:21:38 +0200 Subject: [PATCH 2/3] npm: only source npm completion cache if file exists --- plugins/npm/npm.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index fd2703ce1..b5166b517 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -6,7 +6,7 @@ [[ $? -ne 0 ]] && rm -f $__NPM_COMPLETION_FILE fi - source $__NPM_COMPLETION_FILE + [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE } # Install dependencies globally From b70842bae4346c793e4932d467dd566baeee7d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 10 Sep 2016 00:23:16 +0200 Subject: [PATCH 3/3] npm: unset NPM_COMPLETION_FILE variable --- plugins/npm/npm.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh index b5166b517..02e4f3e93 100644 --- a/plugins/npm/npm.plugin.zsh +++ b/plugins/npm/npm.plugin.zsh @@ -7,6 +7,8 @@ fi [[ -f $__NPM_COMPLETION_FILE ]] && source $__NPM_COMPLETION_FILE + + unset __NPM_COMPLETION_FILE } # Install dependencies globally