Created
August 13, 2015 14:34
-
-
Save manekinekko/be422441a0a90f0057da to your computer and use it in GitHub Desktop.
This script uses the `plugins/fetch.json` cordova file to batch install all the required plugins at once.
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 | |
//this hook installs all your plugins | |
// add your plugins to this list--either | |
// the identifier, the filesystem location | |
// or the URL | |
var plugins = require('./plugins/fetch.json'); | |
var pluginlist = []; | |
for( var prop in plugins) { | |
if(plugins[prop].source.id){ | |
pluginlist.push(plugins[prop].source.id); | |
} | |
else { | |
pluginlist.push(plugins[prop].source.url); | |
} | |
} | |
// no need to configure below | |
var sys = require('sys') | |
var exec = require('child_process').exec; | |
function puts(error, stdout, stderr) { | |
sys.puts(stdout); | |
} | |
pluginlist.forEach(function(plug) { | |
exec("cordova plugin add " + plug, puts); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment