From a1aae0da5266bc59c6cf1d07665af7e8eefc2f49 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Tue, 30 May 2017 14:39:39 +0200 Subject: [PATCH] Allow `type` fields in metafiles to hide type prompt This closes #603 --- lib/read-metadata.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/read-metadata.js b/lib/read-metadata.js index 78321b1..185dbd5 100644 --- a/lib/read-metadata.js +++ b/lib/read-metadata.js @@ -40,11 +40,21 @@ async function readMetaData( } } + // We can remove this once the prompt for choosing `--npm` or `--docker` is gone + if (pkg && pkg.now && pkg.now.type) { + type = nowConfig.type + } + + // The same goes for this + if (nowConfig && nowConfig.type) { + type = nowConfig.type + } + if (!type) { type = await determineType(path) // Both `package.json` and `Dockerfile` exist! Prompt the user to pick one. - // We can remove this soon (details are internal) + // We can remove this soon (details are internal) - also read the comment paragraph above if (type === 'docker' && (pkg && dockerfile)) { const err = new Error( 'Ambiguous deployment (`package.json` and `Dockerfile` found). ' +