From 53f1ffab404855c6f9e697042a2cf4fbc5513b8d Mon Sep 17 00:00:00 2001 From: Matheus Fernandes Date: Sat, 29 Oct 2016 09:01:00 -0200 Subject: [PATCH] Fix code style :nail_care: (#107) --- lib/read-metadata.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/read-metadata.js b/lib/read-metadata.js index e42fc2b..c76d5d4 100644 --- a/lib/read-metadata.js +++ b/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