mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(signal): share signal-cli config path
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user