MCPcopy
hub / github.com/coder/mux / renameWorkspace

Method renameWorkspace

src/node/runtime/DevcontainerRuntime.ts:871–900  ·  view source on GitHub ↗
(
    projectPath: string,
    oldName: string,
    newName: string,
    _abortSignal?: AbortSignal,
    trusted?: boolean
  )

Source from the content-addressed store, hash-verified

869 }
870
871 async renameWorkspace(
872 projectPath: string,
873 oldName: string,
874 newName: string,
875 _abortSignal?: AbortSignal,
876 trusted?: boolean
877 ): Promise<
878 { success: true; oldPath: string; newPath: string } | { success: false; error: string }
879 > {
880 // Stop container before rename (container labels reference old path)
881 const oldPath = this.getWorkspacePath(projectPath, oldName);
882 await devcontainerDown(oldPath, this.configPath);
883
884 // Rename worktree on host
885 const result = await this.worktreeManager.renameWorkspace(
886 projectPath,
887 oldName,
888 newName,
889 trusted
890 );
891
892 if (result.success) {
893 // Update current workspace path if this was the active workspace
894 if (this.currentWorkspacePath === oldPath) {
895 this.currentWorkspacePath = result.newPath;
896 }
897 }
898
899 return result;
900 }
901
902 async deleteWorkspace(
903 projectPath: string,

Callers

nothing calls this directly

Calls 3

getWorkspacePathMethod · 0.95
devcontainerDownFunction · 0.90
renameWorkspaceMethod · 0.65

Tested by

no test coverage detected