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}`); };