From 7c14fd7cb1e40414076d69cb782245b95d54d0cc Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 17 Feb 2017 08:44:22 +1100 Subject: [PATCH] =?UTF-8?q?Fix=20now=20alias=20failing=20when=20now.json?= =?UTF-8?q?=20doesn=E2=80=99t=20define=20deployment=20type=20(#321)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/read-metadata.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/read-metadata.js b/lib/read-metadata.js index 1897fd6..5ae261a 100644 --- a/lib/read-metadata.js +++ b/lib/read-metadata.js @@ -1,6 +1,6 @@ const {basename, resolve: resolvePath} = require('path') const chalk = require('chalk') -const {readFile} = require('fs-promise') +const {readFile, exists} = require('fs-promise') const {parse: parseDockerfile} = require('docker-file-parser') const listPackage = { @@ -45,6 +45,8 @@ async function readMetaData(path, { // when both a package.json and Dockerfile exist if (nowConfig.type) { deploymentType = nowConfig.type + } else if (nowConfig.type === undefined && !await exists(resolvePath(path, 'package.json'))) { + deploymentType = 'static' } if (nowConfig.name) { deploymentName = nowConfig.name