Skip to content

Instantly share code, notes, and snippets.

@muratsu
Created November 14, 2014 19:05
Show Gist options
  • Save muratsu/2c90091d205e07262302 to your computer and use it in GitHub Desktop.
Save muratsu/2c90091d205e07262302 to your computer and use it in GitHub Desktop.
Hook to install plugins when a platform is added to cordova
#!/usr/bin/env node
//this hook installs all your plugins
var pluginlist = [
"org.apache.cordova.device",
"org.apache.cordova.console"
];
var fs = require('fs');
var path = require('path');
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