[Refactor] Reduce a sed command with pipe

Peter Dave Hello 2017-04-05 04:58:34 +08:00 committed by Jordan Harband
parent f524bcb973
commit 3f5fd57881
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 1 additions and 2 deletions

View File

@ -242,8 +242,7 @@ nvm_check_global_modules() {
local NPM_GLOBAL_MODULES local NPM_GLOBAL_MODULES
NPM_GLOBAL_MODULES="$( NPM_GLOBAL_MODULES="$(
npm list -g --depth=0 | npm list -g --depth=0 |
command sed '/ npm@/d' | command sed -e '/ npm@/d' -e '/ (empty)$/d'
command sed '/ (empty)$/d'
)" )"
local MODULE_COUNT local MODULE_COUNT