File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " angularity" ,
33 "description" : " An oppionated node-js build system for Ecmascript-6 Angular-js projects" ,
4- "version" : " 0.0.19 " ,
4+ "version" : " 0.0.20 " ,
55 "tags" : [
66 " build" ,
77 " system" ,
Original file line number Diff line number Diff line change @@ -304,11 +304,11 @@ gulp.task('init:karma', function () {
304304} ) ;
305305
306306gulp . task ( 'init:jshint' , function ( ) {
307- writeTemplate ( '.jshintrc' ) ;
307+ copyTemplateSync ( '.jshintrc' ) ;
308308} ) ;
309309
310310gulp . task ( 'init:gitignore' , function ( ) {
311- writeTemplate ( '.gitignore' ) ;
311+ copyTemplateSync ( '.gitignore' ) ;
312312} ) ;
313313
314314function padded ( length ) {
@@ -359,4 +359,15 @@ function writeTemplate(filename, subdir) {
359359 fs . writeFileSync ( destAbsolute , merged ) ;
360360 gutil . log ( 'created file ' + destRelative ) ;
361361 }
362+ }
363+
364+ function copyTemplateSync ( filename , subdir ) {
365+ var srcAbsolute = path . join ( TEMPLATE_PATH , filename ) ;
366+ var destRelative = path . join ( subdir || '.' , filename ) ;
367+ var destAbsolute = path . resolve ( destRelative ) ;
368+ if ( fs . existsSync ( srcAbsolute ) && ! fs . existsSync ( destAbsolute ) ) {
369+ var templateContent = fs . readFileSync ( srcAbsolute ) . toString ( ) ;
370+ fs . writeFileSync ( destAbsolute , templateContent ) ;
371+ gutil . log ( 'created file ' + destRelative ) ;
372+ }
362373}
You can’t perform that action at this time.
0 commit comments