|
|
@ -23,12 +23,14 @@ async function readMetaData(path, { |
|
|
|
}) { |
|
|
|
let pkg = {} |
|
|
|
let nowConfig = {} |
|
|
|
let hasNowJson = false |
|
|
|
|
|
|
|
let name |
|
|
|
let description |
|
|
|
|
|
|
|
try { |
|
|
|
nowConfig = JSON.parse(await readFile(resolvePath(path, 'now.json'))) |
|
|
|
hasNowJson = true |
|
|
|
} catch (err) { |
|
|
|
// if the file doesn't exist then that's fine; any other error bubbles up
|
|
|
|
if (err.code !== 'ENOENT') { |
|
|
@ -127,11 +129,15 @@ async function readMetaData(path, { |
|
|
|
name = deploymentName |
|
|
|
} |
|
|
|
|
|
|
|
// if the project has both a `now.json` and `now` Object in the `package.json`
|
|
|
|
// file, then fail hard and let the user know that they need to pick one or the
|
|
|
|
// other
|
|
|
|
if (pkg.now) { |
|
|
|
throw new Error('Refusing to proceed with multiple Now configurations (`now.json` and `package.json`). Please pick only one, then try again!') |
|
|
|
// if the project has both a `now.json` and `now` Object in the `package.json`
|
|
|
|
// file, then fail hard and let the user know that they need to pick one or the
|
|
|
|
// other
|
|
|
|
if (hasNowJson) { |
|
|
|
throw new Error('Refusing to proceed with multiple Now configurations (`now.json` and `package.json`). Please pick only one, then try again!') |
|
|
|
} else { |
|
|
|
nowConfig = pkg.now |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|