Be resilient to malformed ephemeral.json
This commit is contained in:
@@ -8,7 +8,8 @@ module.exports = {
|
||||
start,
|
||||
};
|
||||
|
||||
function start(name, targetPath) {
|
||||
function start(name, targetPath, options = {}) {
|
||||
const { allowMalformedOnStartup } = options;
|
||||
let cachedValue = null;
|
||||
|
||||
try {
|
||||
@@ -23,7 +24,7 @@ function start(name, targetPath) {
|
||||
cachedValue = Object.create(null);
|
||||
}
|
||||
} catch (error) {
|
||||
if (error.code !== 'ENOENT') {
|
||||
if (!allowMalformedOnStartup && error.code !== 'ENOENT') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user