@@ -23,17 +23,18 @@ var cliArgs;
2323var config = defaults . getInstance ( 'init' )
2424 . file ( platform . userHomeDirectory ( ) , '.angularity' )
2525 . defaults ( {
26- name : 'my-project' ,
27- version : '0.0.0' ,
28- description : '' ,
29- tag : [ ] ,
30- port : 'random' ,
31- npm : true ,
32- bower : true ,
33- karma : true ,
34- jshint : true ,
35- gitignore : true ,
36- ide : 'none'
26+ name : 'my-project' ,
27+ version : '0.0.0' ,
28+ description : '' ,
29+ tag : [ ] ,
30+ port : 'random' ,
31+ npm : true ,
32+ bower : true ,
33+ karma : true ,
34+ jshint : true ,
35+ gitignore : true ,
36+ editorconfig : true ,
37+ ide : 'none'
3738 } ) ;
3839
3940var check = yargs . createCheck ( )
@@ -133,6 +134,7 @@ yargs.getInstance('init')
133134 '* karma.conf.js exists, else create --karma' ,
134135 '* .jshintrc exists, else create --jshint' ,
135136 '* .gitignore exists, else create --gitignore' ,
137+ '* .editorconfig exists, else create --editorconfig' ,
136138 '* run IDE task --ide' ,
137139 '' ,
138140 'If a package.json is present initialisation will occur in the current directory. Otherwise a sub-directory is' +
@@ -215,6 +217,11 @@ yargs.getInstance('init')
215217 boolean : true ,
216218 default : config . get ( 'gitignore' )
217219 } )
220+ . options ( 'editorconfig' , {
221+ describe : 'Create .editorconfig' ,
222+ boolean : true ,
223+ default : config . get ( 'editorconfig' )
224+ } )
218225 . options ( 'ide' , {
219226 describe : 'Run an IDE initialisation task' ,
220227 string : true ,
@@ -256,7 +263,8 @@ gulp.task('init', function (done) {
256263 cliArgs . bower && 'init:bower' ,
257264 cliArgs . karma && 'init:karma' ,
258265 cliArgs . jshint && 'init:jshint' ,
259- cliArgs . gitignore && 'init:gitignore'
266+ cliArgs . gitignore && 'init:gitignore' ,
267+ cliArgs . editorconfig && 'init:editorconfig'
260268 ]
261269 . concat ( ideList )
262270 . filter ( Boolean )
@@ -307,6 +315,10 @@ gulp.task('init:gitignore', function () {
307315 copyTemplateSync ( '.gitignore' ) ;
308316} ) ;
309317
318+ gulp . task ( 'init:editorconfig' , function ( ) {
319+ copyTemplateSync ( '.editorconfig' ) ;
320+ } ) ;
321+
310322function padded ( length ) {
311323 return function ( text ) {
312324 return ( text + ( new Array ( length ) ) . join ( ' ' ) ) . slice ( 0 , length ) ;
0 commit comments