From b190c0fff525d4980df3a110a96e0fb845faf21b Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Tue, 21 Mar 2017 10:49:28 +0100 Subject: [PATCH] Removed duplicated "Error" prefix from error messages --- bin/now-deploy.js | 7 ++++++- lib/utils/output/error.js | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/now-deploy.js b/bin/now-deploy.js index cac09b0..df30ab7 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -283,7 +283,12 @@ async function sync(token) { } // Make sure that directory is deployable - await checkPath(path); + try { + await checkPath(path); + } catch (err) { + error(err); + return; + } if (!quiet) { if (gitRepo.main) { diff --git a/lib/utils/output/error.js b/lib/utils/output/error.js index ca0b1fd..347ec46 100644 --- a/lib/utils/output/error.js +++ b/lib/utils/output/error.js @@ -2,5 +2,9 @@ const chalk = require('chalk'); // Prints an error message module.exports = msg => { + if (msg instanceof Error) { + msg = msg.message; + } + console.error(`${chalk.red('> Error!')} ${msg}`); };