refactor(signal): share signal-cli config path

This commit is contained in:
Jesse Merhi
2026-08-09 13:54:23 +10:00
committed by jesse-merhi
parent beee1c8ecb
commit 7bf824bf65
+1 -13
View File
@@ -1,9 +1,8 @@
// Signal plugin module implements daemon behavior.
import { spawn } from "node:child_process";
import os from "node:os";
import path from "node:path";
import { createInterface } from "node:readline";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import { resolveSignalCliConfigPath } from "./signal-cli-config-path.js";
type SignalDaemonOpts = {
cliPath: string;
@@ -82,17 +81,6 @@ function bindSignalCliOutput(params: {
});
}
function resolveSignalCliConfigPath(raw: string): string {
const value = raw.trim();
if (value === "~") {
return os.homedir();
}
if (value.startsWith("~/") || value.startsWith("~\\")) {
return path.join(os.homedir(), value.slice(2));
}
return value;
}
function buildDaemonArgs(opts: SignalDaemonOpts): string[] {
const args: string[] = [];
if (opts.configPath?.trim()) {