Harden computer use runtime and CLI (#4705)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
export function quoteCliCommandArgument(value: string): string {
|
||||
if (/^[a-zA-Z0-9._:/@-]+$/.test(value)) {
|
||||
return value
|
||||
}
|
||||
if (process.platform === 'win32') {
|
||||
return `"${value.replace(/"/g, '\\"')}"`
|
||||
}
|
||||
return `'${value.replaceAll("'", "'\\''")}'`
|
||||
}
|
||||
Reference in New Issue
Block a user