Browse Source

Read docker label correctly, fixes #368 (#501)

master
Jarmo Isotalo 8 years ago
committed by Matheus Fernandes
parent
commit
c05405e193
  1. 18
      lib/read-metadata.js

18
lib/read-metadata.js

@ -91,9 +91,7 @@ async function readMetaData(
name = basename(path)
if (!quiet && !isStatic) {
console.log(
`> No \`name\` in \`package.json\`, using ${chalk.bold(name)}`
)
console.log(`> No \`name\` in \`package.json\`, using ${chalk.bold(name)}`)
}
}
}
@ -125,11 +123,9 @@ async function readMetaData(
// Unescape and convert into string
try {
labels[key] = JSON.parse(args[key])
labels[key] = args[key]
} catch (err) {
const e = Error(
`Error parsing value for LABEL ${key} in \`Dockerfile\``
)
const e = Error(`Error parsing value for LABEL ${key} in \`Dockerfile\``)
e.userError = true
throw e
}
@ -144,13 +140,9 @@ async function readMetaData(
if (!quiet) {
if (hasNowJson) {
console.log(
`> No \`name\` LABEL in \`Dockerfile\` or \`name\` field in \`now.json\`, using ${chalk.bold(name)}`
)
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)}`
)
console.log(`> No \`name\` LABEL in \`Dockerfile\`, using ${chalk.bold(name)}`)
}
}
}

Loading…
Cancel
Save