refactor: rename to openclaw

This commit is contained in:
Peter Steinberger
2026-01-30 03:15:10 +01:00
parent 4583f88626
commit 9a7160786a
2357 changed files with 16688 additions and 16788 deletions

View File

@@ -1,37 +1,13 @@
import path from "node:path";
import { describe, expect, it } from "vitest";
import { detectLegacyWorkspaceDirs } from "./doctor-workspace.js";
describe("detectLegacyWorkspaceDirs", () => {
it("ignores ~/moltbot when it doesn't look like a workspace (e.g. install dir)", () => {
const home = "/home/user";
const workspaceDir = "/home/user/clawd";
const candidate = path.join(home, "moltbot");
const detection = detectLegacyWorkspaceDirs({
workspaceDir,
homedir: () => home,
exists: (value) => value === candidate,
});
it("returns active workspace and no legacy dirs", () => {
const workspaceDir = "/home/user/openclaw";
const detection = detectLegacyWorkspaceDirs({ workspaceDir });
expect(detection.activeWorkspace).toBe(path.resolve(workspaceDir));
expect(detection.legacyDirs).toEqual([]);
});
it("flags ~/moltbot when it contains workspace markers", () => {
const home = "/home/user";
const workspaceDir = "/home/user/clawd";
const candidate = path.join(home, "moltbot");
const agentsPath = path.join(candidate, "AGENTS.md");
const detection = detectLegacyWorkspaceDirs({
workspaceDir,
homedir: () => home,
exists: (value) => value === candidate || value === agentsPath,
});
expect(detection.legacyDirs).toEqual([candidate]);
});
});