1- 'use strict' ;
2-
31var util = require ( 'util' ) ;
42var path = require ( 'path' ) ;
53var yeoman = require ( 'yeoman-generator' ) ;
6-
74var AngularjsGenerator = module . exports = function AngularjsGenerator ( args , options , config ) {
5+ 'use strict' ;
86
97 yeoman . generators . Base . apply ( this , arguments ) ;
108
119 this . on ( 'end' , function ( ) {
12-
1310 this . installDependencies ( { skipInstall : options [ 'skip-install' ] } ) ;
1411 } ) ;
1512
@@ -19,74 +16,75 @@ var AngularjsGenerator = module.exports = function AngularjsGenerator(args, opti
1916util . inherits ( AngularjsGenerator , yeoman . generators . Base ) ;
2017
2118AngularjsGenerator . prototype . askFor = function askFor ( ) {
19+ 'use strict' ;
2220
2321 var cb = this . async ( ) ;
2422
2523 // have Yeoman greet the user.
2624 console . log ( this . yeoman ) ;
2725
2826 var prompts = [ {
29-
3027 name : 'continue' ,
3128 message : 'This will create a new AngularJS application. Continue? (y/n)' ,
3229 default : false
33- } ] ;
30+ } ] ;
3431
35- this . prompt ( prompts , function ( props ) {
36-
32+ this . prompt ( prompts , function ( props ) {
3733 this . moduleName = 'app' ;
38- this . continue = props . continue ;
39-
40- cb ( ) ;
34+ this . continue = props . continue ;
4135
36+ cb ( ) ;
4237 } . bind ( this ) ) ;
4338} ;
4439
4540AngularjsGenerator . prototype . createDirectories = function createDirectories ( ) {
41+ 'use strict' ;
4642
4743 //app
48- this . mkdir ( 'app' ) ;
44+ this . mkdir ( 'app' ) ;
4945 this . mkdir ( 'app/img' ) ;
5046 this . mkdir ( 'app/css' ) ;
5147 this . mkdir ( 'app/js' ) ;
5248 this . mkdir ( 'app/lib' ) ;
5349 this . mkdir ( 'app/partials' ) ;
54-
5550 //test
5651 this . mkdir ( 'test' ) ;
52+ this . mkdir ( 'test/lib/angular' ) ;
5753 this . mkdir ( 'test/e2e' ) ;
5854 this . mkdir ( 'test/unit' ) ;
59-
60- //config
61- this . mkdir ( 'config' )
55+ // karma conf
56+ this . mkdir ( 'conf' ) ;
6257} ;
6358
6459AngularjsGenerator . prototype . addFiles = function addFiles ( ) {
60+ 'use strict' ;
6561
6662 //root
6763 this . copy ( 'Gruntfile.js' , 'Gruntfile.js' ) ;
6864 this . template ( '_package.json' , 'package.json' ) ;
6965 this . copy ( 'aws-config.json' , 'aws-config.json' ) ;
7066 this . copy ( 'gitignore' , '.gitignore' ) ;
71-
7267 //app
73- this . template ( '_index.html' , 'app/index.html' ) ;
68+ this . template ( '_index.html' , 'app/index.html' ) ;
7469 this . template ( '_app.js' , 'app/js/app.js' ) ;
7570 this . template ( '_services.js' , 'app/js/services.js' ) ;
7671 this . template ( '_controllers.js' , 'app/js/controllers.js' ) ;
7772 this . template ( '_filters.js' , 'app/js/filters.js' ) ;
7873 this . template ( '_directives.js' , 'app/js/directives.js' ) ;
7974 this . copy ( 'view1.html' , 'app/partials/view1.html' ) ;
8075 this . copy ( 'app.css' , 'app/css/app.css' ) ;
81- this . copy ( 'robots.txt' , 'app/robots.txt' ) ;
76+ this . copy ( 'robots.txt' , 'app/robots.txt' ) ;
8277 this . copy ( 'gitkeep' , 'app/img/.gitkeep' ) ;
8378 this . copy ( 'gitkeep' , 'app/lib/.gitkeep' ) ;
84-
8579 //test
80+ this . copy ( 'angular.js' , 'test/lib/angular/angular.js' ) ;
81+ this . copy ( 'angular-mocks.js' , 'test/lib/angular/angular-mocks.js' ) ;
82+ this . copy ( 'angular-scenario.js' , 'test/lib/angular/angular-scenario.js' ) ;
83+ this . copy ( 'version.json' , 'test/lib/angular/version.json' ) ;
84+ this . copy ( 'version.txt' , 'test/lib/angular/version.txt' ) ;
8685 this . copy ( 'gitkeep' , 'test/unit/.gitkeep' ) ;
8786 this . copy ( 'gitkeep' , 'test/e2e/.gitkeep' ) ;
88-
89- //config
90- this . copy ( 'karma.conf.js' , 'config/karma.conf.js' ) ;
91- this . copy ( 'karma-e2e.conf.js' , 'config/karma-e2e.conf.js' ) ;
87+ // karma conf
88+ this . copy ( 'karma.conf.js' , 'conf/karma.conf.js' ) ;
89+ this . copy ( 'karma-e2e.conf.js' , 'conf/karma-e2e.conf.js' ) ;
9290} ;
0 commit comments