From 865735a436a806bf336a0883575a372df2e9cffa Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 11 Apr 2016 14:35:49 -0400 Subject: [PATCH] Tolerate malformed .meteor-portable files. --- tools/isobuild/meteor-npm.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/isobuild/meteor-npm.js b/tools/isobuild/meteor-npm.js index cb506bcc4c..cfda807752 100644 --- a/tools/isobuild/meteor-npm.js +++ b/tools/isobuild/meteor-npm.js @@ -153,9 +153,15 @@ meteorNpm.dependenciesArePortable = function (nodeModulesDir) { // important that we put separate files in the individual top-level // package directories so that they will get cleared away the next // time those packages are (re)installed. + const portableFile = files.pathJoin(item, ".meteor-portable"); - if (files.exists(portableFile)) { + try { return JSON.parse(files.readFile(portableFile)); + } catch (e) { + if (! (e instanceof SyntaxError || + e.code === "ENOENT")) { + throw e; + } } const result = isPortable(item);