mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 21:44:32 +00:00
refactor(daemon): share service arg types across backends
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { splitArgsPreservingQuotes } from "./arg-split.js";
|
||||
import type { GatewayServiceRenderArgs } from "./service-types.js";
|
||||
|
||||
function systemdEscapeArg(value: string): string {
|
||||
if (!/[\\s"\\\\]/.test(value)) {
|
||||
@@ -27,12 +28,7 @@ export function buildSystemdUnit({
|
||||
programArguments,
|
||||
workingDirectory,
|
||||
environment,
|
||||
}: {
|
||||
description?: string;
|
||||
programArguments: string[];
|
||||
workingDirectory?: string;
|
||||
environment?: Record<string, string | undefined>;
|
||||
}): string {
|
||||
}: GatewayServiceRenderArgs): string {
|
||||
const execStart = programArguments.map(systemdEscapeArg).join(" ");
|
||||
const descriptionLine = `Description=${description?.trim() || "OpenClaw Gateway"}`;
|
||||
const workingDirLine = workingDirectory
|
||||
|
||||
Reference in New Issue
Block a user