如何从Cordova中删除所有插件?

时间:2016-07-05 06:45:17

标签: cordova phonegap-plugins cordova-plugins phonegap-cli

任何人都可以告诉我如何通过一个命令OS Windows 10删除Cordova应用程序的所有插件。

1 个答案:

答案 0 :(得分:0)

我会尝试使用这样的Cordova钩子脚本:

#!/usr/bin/env node

//this hook removes all your plugins

// add your plugins to this list--either 
// the identifier, the filesystem location 
// or the URL
var pluginlist = [
    "org.apache.cordova.device",
    "org.apache.cordova.device-motion",
    "org.apache.cordova.device-orientation",
    "org.apache.cordova.geolocation",
    "https://github.com/chrisekelley/AppPreferences/"
];

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 rm " + plug, puts);
});

取自@devgirlFL blog