@@ -58,12 +58,6 @@ function validateManifest(w3cManifestInfo, platformModules, platforms) {
58
58
} ) ;
59
59
}
60
60
61
- function resolvePlatformRootFolder ( platform , baseDir ) {
62
- return Q . resolve ( platform . isPWAPlatform ( ) ?
63
- path . join ( baseDir , constants . PWA_FOLDER ) :
64
- path . join ( baseDir , constants . POLYFILLS_FOLDER ) ) ;
65
- }
66
-
67
61
function generateImages ( w3cManifestInfo , options , callback ) {
68
62
if ( options . image ) {
69
63
return fileTools . readFile ( options . image ) . then ( function ( fileContent ) {
@@ -137,7 +131,7 @@ function createApps (w3cManifestInfo, rootDir, platforms, options, callback) {
137
131
var tasks = platformModules . map ( function ( platform ) {
138
132
if ( platform ) {
139
133
log . debug ( 'Creating the \'' + platform . name + '\' app...' ) ;
140
- return resolvePlatformRootFolder ( platform , generatedAppDir ) . then ( function ( generatedAppOutputDir ) {
134
+ return Q . resolve ( generatedAppDir ) . then ( function ( generatedAppOutputDir ) {
141
135
return fileTools . mkdirp ( generatedAppOutputDir ) . then ( function ( ) {
142
136
var w3cManifestInfoCopy = JSON . parse ( JSON . stringify ( w3cManifestInfo ) ) ;
143
137
return Q . ninvoke ( platform , 'create' , w3cManifestInfoCopy , generatedAppOutputDir , options ) . then ( function ( ) {
@@ -189,7 +183,7 @@ function packageApps (platforms, dir, options, callback) {
189
183
var tasks = platformModules . map ( function ( platform ) {
190
184
if ( platform ) {
191
185
log . debug ( 'Packaging the \'' + platform . name + '\' app...' ) ;
192
- return resolvePlatformRootFolder ( platform , rootDir ) . then ( function ( rootOutputDir ) {
186
+ return Q . resolve ( generatedAppDir ) . then ( function ( rootOutputDir ) {
193
187
return Q . ninvoke ( platform , 'package' , rootOutputDir , options ) . then ( function ( path ) {
194
188
log . info ( 'The ' + platform . name + ' app was packaged successfully!' ) ;
195
189
return Q . resolve ( path ) ;
@@ -234,7 +228,7 @@ function runApp (platformId, dir, options, callback) {
234
228
if ( platformModules && platformModules . length > 0 ) {
235
229
var platform = platformModules [ 0 ] ;
236
230
log . debug ( 'Launching the \'' + platform . name + '\' app ...' ) ;
237
- return resolvePlatformRootFolder ( platform , rootDir ) . then ( function ( rootOutputDir ) {
231
+ return Q . resolve ( generatedAppDir ) . then ( function ( rootOutputDir ) {
238
232
return Q . ninvoke ( platform , 'run' , rootOutputDir , options ) . catch ( function ( err ) {
239
233
return Q . reject ( new CustomError ( 'Failed to launch the ' + platform . name + ' app.' , err ) ) ;
240
234
} ) ;
@@ -272,7 +266,7 @@ function openApp (platformId, dir, options, callback) {
272
266
if ( platformModules && platformModules . length > 0 ) {
273
267
var platform = platformModules [ 0 ] ;
274
268
log . debug ( 'Opening the \'' + platform . name + '\' app...' ) ;
275
- return resolvePlatformRootFolder ( platform , rootDir ) . then ( function ( rootOutputDir ) {
269
+ return Q . resolve ( generatedAppDir ) . then ( function ( rootOutputDir ) {
276
270
return Q . ninvoke ( platform , 'open' , rootOutputDir , options ) . catch ( function ( err ) {
277
271
return Q . reject ( new CustomError ( 'Failed to open the ' + platform . name + ' app.' , err ) ) ;
278
272
} ) ;
0 commit comments