mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 02:02:45 +00:00
refactor(commands): centralize shared command formatting helpers
This commit is contained in:
@@ -6,7 +6,7 @@ import type { RuntimeEnv } from "../runtime.js";
|
||||
import { stylePromptHint, stylePromptMessage, stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { resolveHomeDir } from "../utils.js";
|
||||
import { resolveCleanupPlanFromDisk } from "./cleanup-plan.js";
|
||||
import { removePath } from "./cleanup-utils.js";
|
||||
import { removePath, removeStateAndLinkedPaths, removeWorkspaceDirs } from "./cleanup-utils.js";
|
||||
|
||||
type UninstallScope = "service" | "state" | "workspace" | "app";
|
||||
|
||||
@@ -164,19 +164,15 @@ export async function uninstallCommand(runtime: RuntimeEnv, opts: UninstallOptio
|
||||
}
|
||||
|
||||
if (scopes.has("state")) {
|
||||
await removePath(stateDir, runtime, { dryRun, label: stateDir });
|
||||
if (!configInsideState) {
|
||||
await removePath(configPath, runtime, { dryRun, label: configPath });
|
||||
}
|
||||
if (!oauthInsideState) {
|
||||
await removePath(oauthDir, runtime, { dryRun, label: oauthDir });
|
||||
}
|
||||
await removeStateAndLinkedPaths(
|
||||
{ stateDir, configPath, oauthDir, configInsideState, oauthInsideState },
|
||||
runtime,
|
||||
{ dryRun },
|
||||
);
|
||||
}
|
||||
|
||||
if (scopes.has("workspace")) {
|
||||
for (const workspace of workspaceDirs) {
|
||||
await removePath(workspace, runtime, { dryRun, label: workspace });
|
||||
}
|
||||
await removeWorkspaceDirs(workspaceDirs, runtime, { dryRun });
|
||||
}
|
||||
|
||||
if (scopes.has("app")) {
|
||||
|
||||
Reference in New Issue
Block a user