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

Method deleteWorkspace

src/node/runtime/DevcontainerRuntime.ts:902–920  ·  view source on GitHub ↗
(
    projectPath: string,
    workspaceName: string,
    force: boolean,
    _abortSignal?: AbortSignal,
    trusted?: boolean
  )

Source from the content-addressed store, hash-verified

900 }
901
902 async deleteWorkspace(
903 projectPath: string,
904 workspaceName: string,
905 force: boolean,
906 _abortSignal?: AbortSignal,
907 trusted?: boolean
908 ): Promise<{ success: true; deletedPath: string } | { success: false; error: string }> {
909 const workspacePath = this.getWorkspacePath(projectPath, workspaceName);
910
911 // Stop and remove container (best-effort)
912 try {
913 await devcontainerDown(workspacePath, this.configPath);
914 } catch (error) {
915 log.debug("devcontainerDown failed (container may not exist):", { error });
916 }
917
918 // Delete worktree on host
919 return this.worktreeManager.deleteWorkspace(projectPath, workspaceName, force, trusted);
920 }
921
922 async forkWorkspace(params: WorkspaceForkParams): Promise<WorkspaceForkResult> {
923 // Fork creates a new worktree - container will be built on first ensureReady

Callers

nothing calls this directly

Calls 4

getWorkspacePathMethod · 0.95
devcontainerDownFunction · 0.90
debugMethod · 0.80
deleteWorkspaceMethod · 0.65

Tested by

no test coverage detected