Browse Source

add `now.json:name` field support

master
Nathan Rajlich 8 years ago
parent
commit
957744e3a5
  1. 19
      lib/read-metadata.js

19
lib/read-metadata.js

@ -40,10 +40,15 @@ async function readMetaData(path, {
} }
} }
// user can specify the type of deployment explicitly in the `now.json` file if (hasNowJson) {
// when both a package.json and Dockerfile exist // user can specify the type of deployment explicitly in the `now.json` file
if (hasNowJson && nowConfig.type) { // when both a package.json and Dockerfile exist
deploymentType = nowConfig.type if (nowConfig.type) {
deploymentType = nowConfig.type
}
if (nowConfig.name) {
deploymentName = nowConfig.name
}
} }
if (deploymentType === 'npm') { if (deploymentType === 'npm') {
@ -123,7 +128,11 @@ async function readMetaData(path, {
name = basename(path) name = basename(path)
if (!quiet) { if (!quiet) {
console.log(`> No \`name\` LABEL in \`Dockerfile\`, using ${chalk.bold(name)}`) if (hasNowJson) {
console.log(`> No \`name\` LABEL in \`Dockerfile\` or \`name\` field in `\now.json\`, using ${chalk.bold(name)}`)
} else {
console.log(`> No \`name\` LABEL in \`Dockerfile\`, using ${chalk.bold(name)}`)
}
} }
} }
} }

Loading…
Cancel
Save