diff --git a/bin/update b/bin/update index 3c4b6087..c42e4c8f 100755 --- a/bin/update +++ b/bin/update @@ -144,15 +144,16 @@ fi if [[ -z $npm_all_flag ]]; then checking 'npm nodejs packages (global)' + # Means I miss out on the cool coloring in the output npm_todo=$(npm outdated --global) if [[ -n $npm_todo ]]; then echo "$npm_todo" if [[ -z $npm_flag ]]; then updating 'npm nodejs packages (global)' - sudo npm upgrade --global; + # skip column headers, pass package names to npm install since + # global implies caret semver https://github.com/npm/cli/issues/746 + echo "$npm_todo" | tail -n +2 | cut -f 1 -d ' ' | xargs npm install --global fi - checking 'npm for unupdated packages FIXME TODO' - npm outdated --global else echo -e "${Color_Green}npm nodejs packages already up-to-date!${Color_zOff}" fi