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

Function expandLocalPath

src/node/runtime/SSH2ConnectionPool.ts:116–130  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

114 "~/.ssh/id_dsa",
115];
116function expandLocalPath(value: string): string {
117 if (value === "~") {
118 return os.homedir();
119 }
120
121 if (value.startsWith("~/") || value.startsWith("~\\")) {
122 return path.join(os.homedir(), value.slice(2));
123 }
124
125 if (!path.isAbsolute(value)) {
126 return path.join(os.homedir(), value);
127 }
128
129 return value;
130}
131
132function makeConnectionKey(config: SSHConnectionConfig): string {
133 const parts = [

Callers 1

connectMethod · 0.85

Calls 1

isAbsoluteMethod · 0.80

Tested by

no test coverage detected