Tolerate malformed .meteor-portable files.

This commit is contained in:
Ben Newman
2016-04-11 14:35:49 -04:00
parent 901e4a5c01
commit 865735a436

View File

@@ -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);