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

Function systemdQuote

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

Source from the content-addressed store, hash-verified

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

Callers 1

generateSystemdUnitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected