Browse Source

Fix code style 💅 (#107)

master
Matheus Fernandes 8 years ago
committed by Guillermo Rauch
parent
commit
53f1ffab40
  1. 12
      lib/read-metadata.js

12
lib/read-metadata.js

@ -44,14 +44,14 @@ export default async function (path, {
throw e
}
if (typeof pkg.name !== 'string') {
if (typeof pkg.name === 'string') {
name = pkg.name
} else {
name = basename(path)
if (!quiet && !isStatic) {
console.log(`> No \`name\` in \`package.json\`, using ${chalk.bold(name)}`)
}
} else {
name = pkg.name
}
description = pkg.description
@ -106,14 +106,14 @@ export default async function (path, {
}
})
if (!labels.name) {
if (labels.name) {
name = labels.name
} else {
name = basename(path)
if (!quiet) {
console.log(`> No \`name\` LABEL in \`Dockerfile\`, using ${chalk.bold(name)}`)
}
} else {
name = labels.name
}
description = labels.description

Loading…
Cancel
Save