Created
August 13, 2015 18:52
-
-
Save Palakis/1dc96d95e28661de5c09 to your computer and use it in GitHub Desktop.
Cordova < 3.7.0 : repackage Firefox OS app (because the integrated method produces corrupted archives)
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
#!/usr/bin/env node | |
// Put this file in the hooks/after_compile folder and give it execution rights | |
var fs = require('fs'); | |
var rootdir = process.argv[2]; | |
if(rootdir) { | |
var platforms = (process.env.CORDOVA_PLATFORMS ? process.env.CORDOVA_PLATFORMS.split(',') : []); | |
for(var x = 0; x < platforms.length; x++) { | |
try { | |
var platform = platforms[x].trim().toLowerCase(); | |
if(platform == 'firefoxos') { | |
var exec = require('child_process').exec; | |
// Repackager le zip foireux de "cordova compile" | |
console.log('Repackaging Firefox OS app'); | |
exec("(cd platforms/firefoxos/www/ ; "+ | |
"rm ../build/package.zip ; "+ | |
"zip -r ../build/package.zip ./)", | |
function(error, stdout, stderr) { | |
if(error !== null) { | |
console.log('Error : '+error); | |
} | |
}); | |
} | |
} catch(e) { | |
process.stdout.write(e); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment