Files
orca/src/cli/shell-command-quote.ts
T

12 lines
332 B
TypeScript

import { quotePosixShell } from '../shared/shell/launch/shell-argument-quoting'
export function quoteCliCommandArgument(value: string): string {
if (/^[a-zA-Z0-9._:/@-]+$/.test(value)) {
return value
}
if (process.platform === 'win32') {
return `"${value.replace(/"/g, '\\"')}"`
}
return quotePosixShell(value)
}