From 2691cd67bf733fd4525da8eede85f68fd2e496bd Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Fri, 4 Mar 2016 05:39:26 -0800 Subject: [PATCH] error-handling --- scripts/post-install.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/post-install.js b/scripts/post-install.js index e1b6199..5faf9ac 100755 --- a/scripts/post-install.js +++ b/scripts/post-install.js @@ -1,7 +1,14 @@ #!/usr/bin/env node import login from '../lib/login'; +import chalk from 'chalk'; -login().then(() => { +console.log(`> ${chalk.bold('Authenticating…')}`); + +login() +.then(() => { console.log('> Logged in successfully. Token saved in ~/.now.json'); process.exit(0); +}) +.catch((err) => { + console.error(`> Error. Login filed. Run \`now --login\` to retry.`); });