Skip to content

Commit e395498

Browse files
npvernivjeux
authored andcommitted
Adds .gitignore file to default template (#79)
* Adds .gitignore file to default template * Simplify renames * Reference npm issue in comment * Removing leading slash
1 parent 1bffa4c commit e395498

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

scripts/init.js

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ module.exports = function(hostPath, appName, verbose) {
3737
// Copy the files for the user
3838
fs.copySync(path.join(selfPath, 'template'), hostPath);
3939

40+
// Rename gitignore after the fact to prevent npm from renaming it to .npmignore
41+
// See: https://github.com/npm/npm/issues/1862
42+
fs.move(path.join(hostPath, 'gitignore'), path.join(hostPath, '.gitignore'), []);
43+
4044
// Run another npm install for react and react-dom
4145
console.log('Installing react and react-dom from npm...');
4246
// TODO: having to do two npm installs is bad, can we avoid it?

template/gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
6+
# misc
7+
npm-debug.log

0 commit comments

Comments
 (0)