Skip to content

Instantly share code, notes, and snippets.

@dancourse
Created February 7, 2014 14:44
Show Gist options
  • Save dancourse/8863879 to your computer and use it in GitHub Desktop.
Save dancourse/8863879 to your computer and use it in GitHub Desktop.
Remove then re-add phonegap plugins with a grunt shell script
shell: {
restorePlugins :{
command: function ()
{
var toReturn = [];
var allPlugins = ["camera", "console", "device", "keyboard", "splashscreen", "statusbar", "file", "dialogs", "vibration"];
var preCommand = "org.apache.cordova.";
toReturn.push('echo "[calvium] Restoring plugins"');
for(var x in allPlugins)
{
toReturn.push("phonegap plugin remove "+preCommand+allPlugins[x]);
}
for(x in allPlugins)
{
toReturn.push("phonegap plugin add "+preCommand+allPlugins[x]);
}
toReturn.push('say Done, good luck');
return toReturn.join('&&');
},
options: {
stdout: true
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment