Skip to content

Commit 4e4c842

Browse files
committed
feat(init): 添加 .gitignore
1 parent e6cd554 commit 4e4c842

File tree

5 files changed

+122
-2
lines changed

5 files changed

+122
-2
lines changed

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ gulp.task('compileJS', [], function() {
2323
})
2424

2525
gulp.task('moveConfig', [], function() {
26-
return watch('src/config/**/*.*', {
26+
return watch(['src/config/**/*.*', 'src/config/**/.*'], {
2727
verbose: true,
2828
ignoreInitial: false
2929
}, () => {
30-
gulp.src('src/config/**/*.*', {base: 'src/'}).pipe(gulp.dest('lib'));
30+
gulp.src(['src/config/**/*.*', 'src/config/**/.*'], {base: 'src/'}).pipe(gulp.dest('lib'));
3131
})
3232
});

lib/commands/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ exports.run = function (options) {
169169

170170
function createTmpl(callback) {
171171
fs.copySync(sysPath.resolve(initTmplPath, './index.html'), sysPath.resolve(cwd, './index.html'));
172+
fs.copySync(sysPath.resolve(initTmplPath, './.gitignore'), sysPath.resolve(cwd, './.gitignore'));
172173
fs.copySync(sysPath.resolve(initTmplPath, './src'), sysPath.resolve(cwd, './src'));
173174
callback(null);
174175
}

lib/config/initTmpl/.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
*.pid.lock
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# nyc test coverage
19+
.nyc_output
20+
21+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22+
.grunt
23+
24+
# Bower dependency directory (https://bower.io/)
25+
bower_components
26+
27+
# node-waf configuration
28+
.lock-wscript
29+
30+
# Compiled binary addons (http://nodejs.org/api/addons.html)
31+
build/Release
32+
33+
# Dependency directories
34+
node_modules/
35+
jspm_packages/
36+
37+
# Typescript v1 declaration files
38+
typings/
39+
40+
# Optional npm cache directory
41+
.npm
42+
43+
# Optional eslint cache
44+
.eslintcache
45+
46+
# Optional REPL history
47+
.node_repl_history
48+
49+
# Output of 'npm pack'
50+
*.tgz
51+
52+
# Yarn Integrity file
53+
.yarn-integrity
54+
55+
# dotenv environment variables file
56+
.env
57+
58+
# ykit cache file
59+
.ykit_cache

src/commands/init.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ exports.run = function (options) {
179179

180180
function createTmpl(callback) {
181181
fs.copySync(sysPath.resolve(initTmplPath, './index.html'), sysPath.resolve(cwd, './index.html'));
182+
fs.copySync(sysPath.resolve(initTmplPath, './.gitignore'), sysPath.resolve(cwd, './.gitignore'));
182183
fs.copySync(sysPath.resolve(initTmplPath, './src'), sysPath.resolve(cwd, './src'));
183184
callback(null);
184185
}

src/config/initTmpl/.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
*.pid.lock
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# nyc test coverage
19+
.nyc_output
20+
21+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22+
.grunt
23+
24+
# Bower dependency directory (https://bower.io/)
25+
bower_components
26+
27+
# node-waf configuration
28+
.lock-wscript
29+
30+
# Compiled binary addons (http://nodejs.org/api/addons.html)
31+
build/Release
32+
33+
# Dependency directories
34+
node_modules/
35+
jspm_packages/
36+
37+
# Typescript v1 declaration files
38+
typings/
39+
40+
# Optional npm cache directory
41+
.npm
42+
43+
# Optional eslint cache
44+
.eslintcache
45+
46+
# Optional REPL history
47+
.node_repl_history
48+
49+
# Output of 'npm pack'
50+
*.tgz
51+
52+
# Yarn Integrity file
53+
.yarn-integrity
54+
55+
# dotenv environment variables file
56+
.env
57+
58+
# ykit cache file
59+
.ykit_cache

0 commit comments

Comments
 (0)