(command: string, hostName: string, user?: string)
| 153 | } |
| 154 | |
| 155 | function 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. |
no outgoing calls
no test coverage detected