mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 06:20:22 +08:00
1.1.79: 修复 bug,修复稳定性(#165 #166 #167)
This commit is contained in:
1 parent
18fe3b51cb
commit
bb93c6a2b6
17 files changed
+872
-185
No files matched your search
+8
-1
@@ -205,7 +205,9 @@ function unregisterProfiles(profiles) {
|
||||
return { stripped, errors };
|
||||
}
|
||||
|
||||
export async function uninstallPurge() {
|
||||
export async function uninstallPurge(options = {}) {
|
||||
const onStage = typeof options.onStage === "function" ? options.onStage : () => {};
|
||||
onStage("locate");
|
||||
const state = await core.gatherState();
|
||||
const applied = wasApplied(state);
|
||||
const dshHome = state.dsh_home || core.findDshHome();
|
||||
@@ -225,6 +227,7 @@ export async function uninstallPurge() {
|
||||
};
|
||||
|
||||
try {
|
||||
onStage("revert");
|
||||
if (state.ai_base) {
|
||||
report.patches = await core.revertAll(state.ai_base);
|
||||
if (applied) report.reverted = true;
|
||||
@@ -240,6 +243,7 @@ export async function uninstallPurge() {
|
||||
}
|
||||
|
||||
try {
|
||||
onStage("shim");
|
||||
report.shim = await core.revertAllShims();
|
||||
if (state.shim_cmd === "patched" || state.shim_ps1 === "patched" || state.shim_bin === "patched") {
|
||||
report.reverted = true;
|
||||
@@ -248,6 +252,7 @@ export async function uninstallPurge() {
|
||||
report.errors.push(`revert shims: ${e.message || e}`);
|
||||
}
|
||||
|
||||
onStage("flash");
|
||||
try {
|
||||
report.flash = core.revertCmdFlash(state.ai_base, dshHome);
|
||||
} catch (e) {
|
||||
@@ -297,7 +302,9 @@ export async function uninstallPurge() {
|
||||
return report;
|
||||
}
|
||||
|
||||
onStage("cleanup");
|
||||
report.cleanup = collectCleanupDirs(profiles, dshHome);
|
||||
onStage("done");
|
||||
return report;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user