From 4661d46f40bb418fedd6f1cf499fb59882b7b68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=A6=E5=BD=A6?= Date: Thu, 12 Oct 2017 10:14:33 +0800 Subject: [PATCH] feat: ignore .git folder for init command --- src/init.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/init.js b/src/init.js index e164a8b..7a0c52d 100644 --- a/src/init.js +++ b/src/init.js @@ -24,7 +24,9 @@ function init({ demo, install }) { const dest = process.cwd(); const projectName = basename(dest); - if (!emptyDir(dest)) { + if (!emptyDir(dest, function(filepath) { + return !/\.git/i.test(filepath); + })) { error('Existing files here, please run init command in an empty folder!'); process.exit(1); }