Skip to content

Instantly share code, notes, and snippets.

@aaccurso
Created August 19, 2014 01:37
Show Gist options
  • Save aaccurso/b0815175390a8a33a35d to your computer and use it in GitHub Desktop.
Save aaccurso/b0815175390a8a33a35d to your computer and use it in GitHub Desktop.
before_prepare hook for cordova
#!/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