Skip to content

Commit 5cfecf1

Browse files
committed
fix: LocalRuntime.renameWorkspace should be no-op like deleteWorkspace
1 parent 491c30e commit 5cfecf1

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/node/runtime/LocalRuntime.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ describe("LocalRuntime", () => {
132132
});
133133

134134
describe("renameWorkspace", () => {
135-
it("returns error - operation not supported", async () => {
135+
it("is a no-op that returns success with same path", async () => {
136136
const runtime = new LocalRuntime(testDir);
137137

138138
const result = await runtime.renameWorkspace(testDir, "old", "new");
139139

140-
expect(result.success).toBe(false);
141-
if (!result.success) {
142-
expect(result.error).toContain("Cannot rename");
143-
expect(result.error).toContain("project-dir");
140+
expect(result.success).toBe(true);
141+
if (result.success) {
142+
expect(result.oldPath).toBe(testDir);
143+
expect(result.newPath).toBe(testDir);
144144
}
145145
});
146146
});

src/node/runtime/LocalRuntime.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ export class LocalRuntime extends LocalBaseRuntime {
9494
}
9595

9696
/**
97-
* Renaming is not supported for LocalRuntime since we use the project directory directly.
97+
* Renaming is a no-op for LocalRuntime - the workspace path is always the project directory.
98+
* Returns success so the metadata (workspace name) can be updated in config.
9899
*/
99100
// eslint-disable-next-line @typescript-eslint/require-await
100101
async renameWorkspace(
@@ -105,10 +106,8 @@ export class LocalRuntime extends LocalBaseRuntime {
105106
): Promise<
106107
{ success: true; oldPath: string; newPath: string } | { success: false; error: string }
107108
> {
108-
return {
109-
success: false,
110-
error: "Cannot rename a local project-dir workspace. The project directory path is fixed.",
111-
};
109+
// No filesystem operation needed - path stays the same
110+
return { success: true, oldPath: this.projectPath, newPath: this.projectPath };
112111
}
113112

114113
/**

0 commit comments

Comments
 (0)