From 1db6879d30751b3037e1aec106286cd87f9058c8 Mon Sep 17 00:00:00 2001 From: leesei Date: Sun, 10 Apr 2016 22:19:50 +0800 Subject: [PATCH] remove duplicated stack dump --- lib/hexo.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/hexo.js b/lib/hexo.js index 01fe9846..34a54206 100644 --- a/lib/hexo.js +++ b/lib/hexo.js @@ -21,7 +21,10 @@ function entry(cwd, args) { process.title = 'hexo'; function handleError(err) { - log.fatal(err); + if (err) { + log.fatal(err); + } + process.exit(2); } @@ -64,7 +67,8 @@ function entry(cwd, args) { return hexo.exit(); }).catch(function(err) { return hexo.exit(err).then(function() { - handleError(err); + // `hexo.exit()` already dumped `err` + handleError(null); }); }); }).catch(handleError);