Browse Source

add `now.json:name` field support

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

11
lib/read-metadata.js

@ -40,11 +40,16 @@ async function readMetaData(path, {
}
}
if (hasNowJson) {
// user can specify the type of deployment explicitly in the `now.json` file
// when both a package.json and Dockerfile exist
if (hasNowJson && nowConfig.type) {
if (nowConfig.type) {
deploymentType = nowConfig.type
}
if (nowConfig.name) {
deploymentName = nowConfig.name
}
}
if (deploymentType === 'npm') {
if (isStatic) {
@ -123,10 +128,14 @@ async function readMetaData(path, {
name = basename(path)
if (!quiet) {
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)}`)
}
}
}
}
description = labels.description
} else {

Loading…
Cancel
Save