mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 06:41:22 +00:00
refactor(commands): dedupe cleanup path resolution
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
import { stylePromptHint, stylePromptMessage, stylePromptTitle } from "../terminal/prompt-style.js";
|
||||
import { resolveHomeDir } from "../utils.js";
|
||||
import { collectWorkspaceDirs, isPathWithin, removePath } from "./cleanup-utils.js";
|
||||
import { buildCleanupPlan, removePath } from "./cleanup-utils.js";
|
||||
|
||||
type UninstallScope = "service" | "state" | "workspace" | "app";
|
||||
|
||||
@@ -161,9 +161,12 @@ export async function uninstallCommand(runtime: RuntimeEnv, opts: UninstallOptio
|
||||
const stateDir = resolveStateDir();
|
||||
const configPath = resolveConfigPath();
|
||||
const oauthDir = resolveOAuthDir();
|
||||
const configInsideState = isPathWithin(configPath, stateDir);
|
||||
const oauthInsideState = isPathWithin(oauthDir, stateDir);
|
||||
const workspaceDirs = collectWorkspaceDirs(cfg);
|
||||
const { configInsideState, oauthInsideState, workspaceDirs } = buildCleanupPlan({
|
||||
cfg,
|
||||
stateDir,
|
||||
configPath,
|
||||
oauthDir,
|
||||
});
|
||||
|
||||
if (scopes.has("service")) {
|
||||
if (dryRun) {
|
||||
|
||||
Reference in New Issue
Block a user