From c05405e193b86247d3610b43b1c22fb9a29a7c7b Mon Sep 17 00:00:00 2001 From: Jarmo Isotalo Date: Thu, 4 May 2017 15:53:22 -0700 Subject: [PATCH] Read docker label correctly, fixes #368 (#501) --- lib/read-metadata.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/lib/read-metadata.js b/lib/read-metadata.js index a2ac4e6..e88bc34 100644 --- a/lib/read-metadata.js +++ b/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)}`) } } }