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

Function expandMatchExecTokens

src/node/runtime/sshConfigParser.ts:155–168  ·  view source on GitHub ↗
(command: string, hostName: string, user?: string)

Source from the content-addressed store, hash-verified

153}
154
155function expandMatchExecTokens(command: string, hostName: string, user?: string): string {
156 return command.replace(/%(%|h|r)/g, (_match, token) => {
157 switch (token) {
158 case "%":
159 return "%";
160 case "h":
161 return hostName;
162 case "r":
163 return user ?? "";
164 default:
165 return _match;
166 }
167 });
168}
169
170/**
171 * Handle `Match host ... !exec ...` blocks that ssh-config doesn't evaluate.

Callers 1

applyNegatedExecMatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected