From 3f5fd57881eaeecfc5b2d681a5806da4a05e37fd Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Wed, 5 Apr 2017 04:58:34 +0800 Subject: [PATCH] [Refactor] Reduce a sed command with pipe --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index ec93902..ac5b367 100755 --- a/install.sh +++ b/install.sh @@ -242,8 +242,7 @@ nvm_check_global_modules() { local NPM_GLOBAL_MODULES NPM_GLOBAL_MODULES="$( npm list -g --depth=0 | - command sed '/ npm@/d' | - command sed '/ (empty)$/d' + command sed -e '/ npm@/d' -e '/ (empty)$/d' )" local MODULE_COUNT