mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 22:14:34 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -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]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user