From 7207108aaab761a1afd1414502cc5b2dacacbd37 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Sun, 28 Oct 2018 15:36:05 +0100 Subject: [PATCH] give templates a common dot.gitignore if a template (built-in, downloaded or otherwise) doesn't supply its own dot.gitignore file then templates/dot.gitignore will be used also, update dot.gitignore to ignore chains.json by default --- lib/utils/template_generator.js | 6 ++---- templates/demo/dot.gitignore | 6 ------ templates/{boilerplate => }/dot.gitignore | 1 + templates/simple/dot.gitignore | 6 ------ 4 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 templates/demo/dot.gitignore rename templates/{boilerplate => }/dot.gitignore (87%) delete mode 100644 templates/simple/dot.gitignore diff --git a/lib/utils/template_generator.js b/lib/utils/template_generator.js index cb36b3b8e..7cef7ca43 100644 --- a/lib/utils/template_generator.js +++ b/lib/utils/template_generator.js @@ -107,10 +107,8 @@ class TemplateGenerator { utils.sed('package.json', '%APP_NAME%', name); if (fs.existsSync('dot.gitignore')) { fs.moveSync('dot.gitignore', '.gitignore'); - } - - if (fs.existsSync('dot.gitignore')) { - fs.moveSync('dot.gitignore', '.gitignore'); + } else if (!fs.existsSync('.gitignore')) { + fs.copySync(fs.embarkPath('templates/dot.gitignore'), '.gitignore'); } if (installPackages) { diff --git a/templates/demo/dot.gitignore b/templates/demo/dot.gitignore deleted file mode 100644 index 641862673..000000000 --- a/templates/demo/dot.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.embark -config/production/password -config/livenet/password -coverage -dist -node_modules diff --git a/templates/boilerplate/dot.gitignore b/templates/dot.gitignore similarity index 87% rename from templates/boilerplate/dot.gitignore rename to templates/dot.gitignore index 641862673..72a305ede 100644 --- a/templates/boilerplate/dot.gitignore +++ b/templates/dot.gitignore @@ -1,4 +1,5 @@ .embark +chains.json config/production/password config/livenet/password coverage diff --git a/templates/simple/dot.gitignore b/templates/simple/dot.gitignore deleted file mode 100644 index 641862673..000000000 --- a/templates/simple/dot.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.embark -config/production/password -config/livenet/password -coverage -dist -node_modules