MCPcopy
hub / github.com/shivammathur/setup-php / escapeForShell

Function escapeForShell

src/utils.ts:226–231  ·  view source on GitHub ↗
(value: string, os: string)

Source from the content-addressed store, hash-verified

224}
225
226export function escapeForShell(value: string, os: string): string {
227 if (os === 'win32') {
228 return value.replace(/[`$"]/g, '`$&');
229 }
230 return value.replace(/[\\`$"]/g, '\\$&');
231}
232
233export function safeArg(value: string, os: string): string {
234 if (!/^[a-zA-Z0-9_./:@+,~^-]*$/.test(value)) {

Callers 3

stepLogFunction · 0.85
addLogFunction · 0.85
safeArgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected