MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / systemdEscapeArg

Function systemdEscapeArg

packages/server/src/svc/systemd-unit.ts:12–18  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

10
11
12function systemdEscapeArg(value: string): string {
13 assertNoLineBreaks(value, 'Systemd unit values');
14 if (!/[\s"\\]/.test(value)) {
15 return value;
16 }
17 return `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
18}
19
20export interface BuildSystemdUnitInput {
21 description?: string;

Callers 1

buildSystemdUnitFunction · 0.85

Calls 1

assertNoLineBreaksFunction · 0.85

Tested by

no test coverage detected