(text: string, cwd: string, shell: string)
| 152 | } |
| 153 | |
| 154 | function expand(text: string, cwd: string, shell: string) { |
| 155 | const out = unquote(text) |
| 156 | .replace(/\$\{env:([^}]+)\}/gi, (_, key: string) => envValue(key) || "") |
| 157 | .replace(/\$env:([A-Za-z_][A-Za-z0-9_]*)/gi, (_, key: string) => envValue(key) || "") |
| 158 | .replace(/\$(HOME|PWD|PSHOME)(?=$|[\\/])/gi, (_, key: string) => auto(key, cwd, shell) || "") |
| 159 | return home(out) |
| 160 | } |
| 161 | |
| 162 | function provider(text: string) { |
| 163 | const match = text.match(/^([A-Za-z]+)::(.*)$/) |