@@ -60,13 +60,45 @@ function run(ionic, argv) {
6060 includeSass : includeSass
6161 } ;
6262
63+ var componentsDir = path . join ( process . cwd ( ) , 'src' , 'components' ) ;
64+ var directivesDir = path . join ( process . cwd ( ) , 'src' , 'components' ) ;
65+ var pagesDir = path . join ( process . cwd ( ) , 'src' , 'pages' ) ;
66+ var pipesDir = path . join ( process . cwd ( ) , 'src' , 'pipes' ) ;
67+ var providersDir = path . join ( process . cwd ( ) , 'src' , 'providers' ) ;
68+ var templateDir = path . join ( process . cwd ( ) , 'node_modules' , 'ionic-angular' , 'templates' ) ;
69+
70+ if ( argv . componentsDir && argv . componentsDir . length > 0 ) {
71+ componentsDir = path . resolve ( argv . componentsDir ) ;
72+ }
73+
74+ if ( argv . directivesDir && argv . directivesDir . length > 0 ) {
75+ directivesDir = path . resolve ( argv . directivesDir ) ;
76+ }
77+
78+ if ( argv . pagesDir && argv . pagesDir . length > 0 ) {
79+ pagesDir = path . resolve ( argv . pagesDir ) ;
80+ }
81+
82+ if ( argv . pipesDir && argv . pipesDir . length > 0 ) {
83+ pipesDir = path . resolve ( argv . pipesDir ) ;
84+ }
85+
86+ if ( argv . providersDir && argv . providersDir . length > 0 ) {
87+ providersDir = path . resolve ( argv . providersDir ) ;
88+ }
89+
90+ if ( argv . templateDir && argv . templateDir . length > 0 ) {
91+ templateDir = path . resolve ( argv . templateDir ) ;
92+ }
93+
94+
6395 var projectStructureOptions = {
64- absoluteComponentDirPath : process . cwd ( ) + '/src/components' ,
65- absoluteDirectiveDirPath : process . cwd ( ) + '/src/components' ,
66- absolutePagesDirPath : process . cwd ( ) + '/src/pages' ,
67- absolutePipeDirPath : process . cwd ( ) + '/src/pipes' ,
68- absoluteProviderDirPath : process . cwd ( ) + '/src/providers' ,
69- absolutePathTemplateBaseDir : process . cwd ( ) + '/node_modules/ionic-angular/templates'
96+ absoluteComponentDirPath : componentsDir ,
97+ absoluteDirectiveDirPath : directivesDir ,
98+ absolutePagesDirPath : pagesDir ,
99+ absolutePipeDirPath : pipesDir ,
100+ absoluteProviderDirPath : providersDir ,
101+ absolutePathTemplateBaseDir : templateDir
70102 } ;
71103
72104 return appGenerator . generate ( generatorOptions , projectStructureOptions ) . catch ( function ( err ) {
0 commit comments