add failure mode for reading project settings

This commit is contained in:
Philip Weiss
2018-02-18 17:56:55 -08:00
parent c69b8d38e8
commit ad40ff9825

View File

@@ -197,7 +197,11 @@ const readProjectSettingsSync = (filepath, executedFrom) => {
}
try {
const readPath = path.isAbsolute(filepath) ? filepath : path.join(executedFrom, filepath)
return CSON.readFileSync(readPath)
const contents = CSON.readFileSync(readPath)
if (contents.paths || content.config) {
return contents
}
} catch (e) {
throw new Error('Unable to read supplied config file.')
}