mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
12 lines
332 B
TypeScript
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)
|
|
}
|