Created
November 14, 2014 19:05
-
-
Save muratsu/2c90091d205e07262302 to your computer and use it in GitHub Desktop.
Hook to install plugins when a platform is added to cordova
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 | |
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