(template: string, values: Record<string, string>)
| 26 | export type Parameters = Schema.Schema.Type<typeof Parameters> |
| 27 | |
| 28 | function renderPrompt(template: string, values: Record<string, string>) { |
| 29 | return template.replace(/\$\{(\w+)\}/g, (_, key: string) => { |
| 30 | const value = values[key] |
| 31 | if (value === undefined) throw new Error(`Missing shell prompt value: ${key}`) |
| 32 | return value |
| 33 | }) |
| 34 | } |
| 35 | |
| 36 | function shellDisplayName(name: string) { |
| 37 | if (name === "pwsh") return "PowerShell (7+)" |