From 242bfd8c68be0c55939b176bad7798607813d620 Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Fri, 7 Feb 2014 15:41:21 -0800 Subject: [PATCH 1/3] NPM install latest made more effecient `npm install` is smart enough to only update updated modules. Checking for `outdated` and running `update` repeats the same process 2x. --- library/packaging/npm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/library/packaging/npm b/library/packaging/npm index 3a4cd13f5d7..19825502589 100644 --- a/library/packaging/npm +++ b/library/packaging/npm @@ -209,12 +209,7 @@ def main(): changed = True npm.install() elif state == 'latest': - installed, missing = npm.list() - outdated = npm.list_outdated() - if len(missing) or len(outdated): - changed = True - npm.install() - npm.update() + npm.install() else: #absent installed, missing = npm.list() if name in installed: From 5655ffa8bf2334752fbf936ecd66e2258aaec8b9 Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Fri, 7 Feb 2014 15:50:17 -0800 Subject: [PATCH 2/3] outdated needed to see set `changed` --- library/packaging/npm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/packaging/npm b/library/packaging/npm index 19825502589..7c03ab383d6 100644 --- a/library/packaging/npm +++ b/library/packaging/npm @@ -209,7 +209,11 @@ def main(): changed = True npm.install() elif state == 'latest': - npm.install() + installed, missing = npm.list() + outdated = npm.list_outdated() + if len(missing) or len(outdated): + changed = True + npm.install() else: #absent installed, missing = npm.list() if name in installed: From 95545ca6897d05cffecb7b823a162bbac78323d4 Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Fri, 7 Feb 2014 15:50:44 -0800 Subject: [PATCH 3/3] indent err --- library/packaging/npm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/packaging/npm b/library/packaging/npm index 7c03ab383d6..b315d70a870 100644 --- a/library/packaging/npm +++ b/library/packaging/npm @@ -212,8 +212,8 @@ def main(): installed, missing = npm.list() outdated = npm.list_outdated() if len(missing) or len(outdated): - changed = True - npm.install() + changed = True + npm.install() else: #absent installed, missing = npm.list() if name in installed: