MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / systemdQuote

Function systemdQuote

apps/cli/src/service.ts:428–437  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

426const SYSTEMD_BARE_VALUE = /^[A-Za-z0-9_@%+=:,./-]+$/;
427
428const systemdQuote = (value: string): string => {
429 if (SYSTEMD_BARE_VALUE.test(value)) return value;
430 const escaped = value
431 .replaceAll("\\", "\\\\")
432 .replaceAll('"', '\\"')
433 .replaceAll("\n", "\\n")
434 .replaceAll("\r", "\\r")
435 .replaceAll("\t", "\\t");
436 return `"${escaped}"`;
437};
438
439/** Render a systemd --user unit. Pure (snapshot-tested). */
440export const generateSystemdUnit = (options: SystemdUnitOptions): string => {

Callers 1

generateSystemdUnitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected