mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
fix(plugins): handle uninstalling multiple plugin assets (#1805)
This commit is contained in:
@@ -141,14 +141,13 @@ const handlers = {
|
|||||||
uninstall: function (obj, plugin, project, options) {
|
uninstall: function (obj, plugin, project, options) {
|
||||||
const target = obj.target || obj.src;
|
const target = obj.target || obj.src;
|
||||||
|
|
||||||
if (!target) throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
|
if (!target) {
|
||||||
|
throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
|
||||||
|
}
|
||||||
|
|
||||||
removeFile(path.resolve(project.www, target));
|
removeFileAndParents(project.www, target);
|
||||||
removeFile(path.resolve(project.www, 'plugins', plugin.id));
|
|
||||||
if (options && options.usePlatformWww) {
|
if (options && options.usePlatformWww) {
|
||||||
// CB-11022 remove file from both directories if usePlatformWww is specified
|
removeFileAndParents(project.platformWww, target);
|
||||||
removeFile(path.resolve(project.platformWww, target));
|
|
||||||
removeFile(path.resolve(project.platformWww, 'plugins', plugin.id));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user