diff --git a/index.js b/index.js index 82a7ac0..e7fdbf7 100644 --- a/index.js +++ b/index.js @@ -110,11 +110,16 @@ function main (opts) { function readJson (jsonPath, name, ignoreMissing) { return fs.readFileAsync(path.join(jsonPath, name), 'utf8') - .then(str => JSON.parse(str)) + .then(stripBOM) + .then(JSON.parse) .catch({code: 'ENOENT'}, err => { if (!ignoreMissing) { throw err } }) } + + function stripBOM (str) { + return str.replace(/^\uFEFF/, '') + } }