(arg: string)
| 49 | // for readability; everything else is wrapped in single quotes with |
| 50 | // embedded single quotes escaped as `'\''`. |
| 51 | export function shellQuote(arg: string): string { |
| 52 | if (arg.length > 0 && /^[A-Za-z0-9_\-+=:,./@%]+$/.test(arg)) return arg; |
| 53 | return `'${arg.replace(/'/g, "'\\''")}'`; |
| 54 | } |
| 55 | |
| 56 | function interpolate(value: ShellValue): string { |
| 57 | if (isRaw(value)) return value.raw; |
no test coverage detected