-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using cordova hooks structure correctly
- Loading branch information
Showing
4 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env node | ||
|
||
var del = require('del'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
var rootdir = process.argv[2]; | ||
|
||
if (rootdir) { | ||
|
||
// go through each of the platform directories that have been prepared | ||
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); | ||
|
||
for(var x=0; x<platforms.length; x++) { | ||
// open up the index.html file at the www root | ||
try { | ||
var platform = platforms[x].trim().toLowerCase(); | ||
var testBuildPath; | ||
|
||
if(platform == 'android') { | ||
testBuildPath = path.join('platforms', platform, 'assets', 'www', 'build', 'test'); | ||
} else { | ||
testBuildPath = path.join('platforms', platform, 'www', 'build', 'test'); | ||
} | ||
|
||
if(fs.existsSync(testBuildPath)) { | ||
console.log('Removing test build from assets after prepare: ' + testBuildPath); | ||
del.sync(testBuildPath); | ||
} else { | ||
console.log('Test build @ ' + testBuildPath + ' does not exist for removal'); | ||
} | ||
|
||
} catch(e) { | ||
process.stdout.write(e); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.