From 54ed3194279c37b522bbfd33496dd7f5a006d546 Mon Sep 17 00:00:00 2001 From: Va Da Date: Tue, 5 Jun 2018 19:32:34 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20show=20nice=20error=20me?= =?UTF-8?q?ssage=20when=20Git=20root=20not=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/createState.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/createState.js b/lib/createState.js index d7054905..92378b46 100644 --- a/lib/createState.js +++ b/lib/createState.js @@ -2,7 +2,14 @@ const getGitRootDir = require('./util/getGitRootDir'); const getConfig = require('./getConfig'); const createState = () => { - const root = getGitRootDir(); + let root; + + try { + root = getGitRootDir(); + } catch (error) { + throw new Error('Could not find Git root folder.'); + } + const state = { answers: { body: '',