diff --git a/lib/read-metadata.js b/lib/read-metadata.js index cbb9cf9..c5636c5 100644 --- a/lib/read-metadata.js +++ b/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 - // when both a package.json and Dockerfile exist - if (hasNowJson && nowConfig.type) { - deploymentType = nowConfig.type + if (hasNowJson) { + // user can specify the type of deployment explicitly in the `now.json` file + // when both a package.json and Dockerfile exist + if (nowConfig.type) { + deploymentType = nowConfig.type + } + if (nowConfig.name) { + deploymentName = nowConfig.name + } } if (deploymentType === 'npm') { @@ -123,7 +128,11 @@ async function readMetaData(path, { name = basename(path) 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)}`) + } } } }