Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var doDelete = function (id) {
var plugin_dir = path.join(plugins_dir, id);
if (!fs.existsSync(plugin_dir)) {
events.emit('verbose', 'Plugin "' + id + '" already removed (' + plugin_dir + ')');
return Promise.resolve();
}
fs.removeSync(plugin_dir);
events.emit('verbose', 'Deleted plugin "' + id + '"');
// remove plugin from node_modules directory
return npmUninstall(id, options.projectRoot, options);
};
return promiseutil.Q_chainmap(targets, function(target) {
if(target in platforms) {
target = 'cordova-'+target;
}
// Edits package.json.
return npmUninstall(target, projectRoot, opts);
});
}
return promiseutil.Q_chainmap(targets, function(target) {
if(target in platforms) {
target = 'cordova-'+target;
}
// Edits package.json.
return npmUninstall(target, projectRoot, opts);
});
}
return promiseutil.Q_chainmap(targets, function (target) {
if (target in platforms) {
target = 'cordova-' + target;
}
// Edits package.json.
return npmUninstall(target, projectRoot, opts);
});
}).then(function () {
var doDelete = function(id) {
var plugin_dir = path.join(plugins_dir, id);
if ( !fs.existsSync(plugin_dir) ) {
events.emit('verbose', 'Plugin "'+ id +'" already removed ('+ plugin_dir +')');
return Q();
}
shell.rm('-rf', plugin_dir);
events.emit('verbose', 'Deleted "'+ id +'"');
if(options.fetch) {
//remove plugin from node_modules directory
return npmUninstall(id, options.projectRoot, options);
}
return Q();
};