Skip to content

Instantly share code, notes, and snippets.

@sgimeno
Created June 10, 2014 08:02
Show Gist options
  • Save sgimeno/f636e2b71c7529ac6ee4 to your computer and use it in GitHub Desktop.
Save sgimeno/f636e2b71c7529ac6ee4 to your computer and use it in GitHub Desktop.
Cordova hooks
#!/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 pluginlist = [
'https://github.com/cogitor/PhoneGap-OrientationLock.git',
'org.apache.cordova.camera',
'org.apache.cordova.file',
'org.apache.cordova.file-transfer',
'org.apache.cordova.geolocation',
'org.apache.cordova.splashscreen'
];
// no need to configure below
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