mirror of
https://github.com/apache/cordova-android.git
synced 2026-01-30 00:05:28 +08:00
fix(plugins): rename & match removeFileF logic with other platforms (#1806)
This commit is contained in:
@@ -42,7 +42,7 @@ const handlers = {
|
||||
deleteJava(project.projectDir, dest);
|
||||
} else {
|
||||
// Just remove the file, not the whole parent directory
|
||||
removeFile(path.resolve(project.projectDir, dest));
|
||||
removeFileF(path.resolve(project.projectDir, dest));
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -53,7 +53,7 @@ const handlers = {
|
||||
},
|
||||
uninstall: function (obj, plugin, project, options) {
|
||||
const dest = path.join('app/libs', path.basename(obj.src));
|
||||
removeFile(path.resolve(project.projectDir, dest));
|
||||
removeFileF(path.resolve(project.projectDir, dest));
|
||||
}
|
||||
},
|
||||
'resource-file': {
|
||||
@@ -63,7 +63,7 @@ const handlers = {
|
||||
},
|
||||
uninstall: function (obj, plugin, project, options) {
|
||||
const dest = path.join('app', 'src', 'main', obj.target);
|
||||
removeFile(path.resolve(project.projectDir, dest));
|
||||
removeFileF(path.resolve(project.projectDir, dest));
|
||||
}
|
||||
},
|
||||
framework: {
|
||||
@@ -102,7 +102,7 @@ const handlers = {
|
||||
|
||||
if (obj.custom) {
|
||||
const subRelativeDir = project.getCustomSubprojectRelativeDir(plugin.id, src);
|
||||
removeFile(path.resolve(project.projectDir, subRelativeDir));
|
||||
removeFileF(path.resolve(project.projectDir, subRelativeDir));
|
||||
subDir = path.resolve(project.projectDir, subRelativeDir);
|
||||
// If it's the last framework in the plugin, remove the parent directory.
|
||||
const parDir = path.dirname(subDir);
|
||||
@@ -247,8 +247,8 @@ function symlinkFileOrDirTree (src, dest) {
|
||||
}
|
||||
}
|
||||
|
||||
function removeFile (file) {
|
||||
fs.rmSync(file);
|
||||
function removeFileF (file) {
|
||||
fs.rmSync(file, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
// Sometimes we want to remove some java, and prune any unnecessary empty directories
|
||||
@@ -261,7 +261,7 @@ function removeFileAndParents (baseDir, destFile, stopper) {
|
||||
const file = path.resolve(baseDir, destFile);
|
||||
if (!fs.existsSync(file)) return;
|
||||
|
||||
removeFile(file);
|
||||
removeFileF(file);
|
||||
|
||||
// check if directory is empty
|
||||
let curDir = path.dirname(file);
|
||||
|
||||
Reference in New Issue
Block a user