Add warning when config parsing fails
Summary: This can quite easily happen if you manually edit it and aren't careful. The least we can do is tell the user about it, because it be a bit surprising otherwise. Reviewed By: jknoxville Differential Revision: D17626760 fbshipit-source-id: 8c7d64b041fa4b97ce2753116800d0e855442dd9
This commit is contained in:
committed by
Facebook Github Bot
parent
dda800c4a3
commit
4b60433425
@@ -41,6 +41,8 @@ module.exports = function(argv) {
|
||||
};
|
||||
} catch (e) {
|
||||
// file not readable or not parsable, overwrite it with the new config
|
||||
console.warn(`Failed to read ${configPath}: ${e}`);
|
||||
console.info('Writing new default config.');
|
||||
fs.writeFileSync(configPath, JSON.stringify(config));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user