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

Function parseSystemctlShow

packages/server/src/svc/systemd-unit.ts:72–84  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

70}
71
72export function parseSystemctlShow(output: string): Record<string, string> {
73 const result: Record<string, string> = {};
74 for (const rawLine of output.split(/\r?\n/)) {
75 const idx = rawLine.indexOf('=');
76 if (idx === -1) continue;
77 const key = rawLine.slice(0, idx).trim();
78 const value = rawLine.slice(idx + 1);
79 if (key.length > 0) {
80 result[key] = value;
81 }
82 }
83 return result;
84}

Callers 2

systemd.test.tsFile · 0.90
statusFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected