MCPcopy Index your code
hub / github.com/coder/mux / resolvePath

Method resolvePath

src/node/runtime/DevcontainerRuntime.ts:747–770  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

745 }
746
747 override async resolvePath(filePath: string): Promise<string> {
748 let expanded = this.expandTildeForContainer(filePath);
749
750 if (this.hasUnexpandedTilde(expanded)) {
751 await this.fetchRemoteHome();
752 if (this.remoteHomeDir) {
753 expanded = filePath === "~" ? this.remoteHomeDir : this.remoteHomeDir + filePath.slice(1);
754 } else {
755 throw new RuntimeError(
756 `Failed to resolve path ${filePath}: container home directory unavailable`,
757 "exec"
758 );
759 }
760 }
761
762 // Resolve relative paths against container workspace (avoid host cwd leakage)
763 if (!expanded.startsWith("/")) {
764 const basePath = this.remoteWorkspaceFolder ?? "/";
765 return path.posix.resolve(basePath, expanded);
766 }
767
768 // For absolute paths, resolve using posix (container is Linux)
769 return path.posix.resolve(expanded);
770 }
771
772 override tempDir(): Promise<string> {
773 const workspaceRoot = this.remoteWorkspaceFolder ?? this.currentWorkspacePath;

Callers

nothing calls this directly

Calls 4

hasUnexpandedTildeMethod · 0.95
fetchRemoteHomeMethod · 0.95
resolveMethod · 0.80

Tested by

no test coverage detected