Created
August 19, 2014 01:37
-
-
Save aaccurso/b0815175390a8a33a35d to your computer and use it in GitHub Desktop.
before_prepare hook for 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 | |
var pluginlist = [ | |
'org.apache.cordova.console', | |
'org.apache.cordova.device', | |
'org.apache.cordova.network-information', | |
'org.apache.cordova.file-transfer', | |
'org.apache.cordova.statusbar', | |
'org.apache.cordova.vibration', | |
'org.apache.cordova.dialogs', | |
'https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git' | |
]; | |
var sys = require('sys'); | |
var exec = require('child_process').exec; | |
var async = require('async'); | |
var installPlugin = function (plugin, callback) { | |
var puts = function (error, stdout, stderr) { | |
sys.puts(stdout); | |
callback(); | |
}; | |
exec('grunt plugin:add:' + plugin, puts); | |
}; | |
async.eachSeries(pluginlist, installPlugin, function (err) { | |
err && sys.puts(err); | |
sys.puts('Plugin installation finished!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment