From 9b13c6b7aa5f2048fe409d07212a02b1fa9c9407 Mon Sep 17 00:00:00 2001 From: orion Date: Sat, 4 Apr 2026 08:33:38 +0000 Subject: [PATCH] fix: only fill missing plugin config values --- scripts/install.mjs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/install.mjs b/scripts/install.mjs index 68e83cc..f7dea8b 100644 --- a/scripts/install.mjs +++ b/scripts/install.mjs @@ -368,14 +368,21 @@ async function configure() { } logOk(`plugins.allow includes ${PLUGIN_NAME}`); + const enabledKey = `plugins.entries.${PLUGIN_NAME}.enabled`; + const configEnabledKey = `plugins.entries.${PLUGIN_NAME}.config.enabled`; + if (getOpenclawConfig(enabledKey, undefined) === undefined) { + setOpenclawConfig(enabledKey, true); + } + if (getOpenclawConfig(configEnabledKey, undefined) === undefined) { + setOpenclawConfig(configEnabledKey, true); + } + if (options.installMonitor === 'yes') { const binaryPath = join(openclawPath, 'plugins', PLUGIN_NAME, 'bin', 'HarborForge.Monitor'); - const entry = getOpenclawConfig(`plugins.entries.${PLUGIN_NAME}`, {}) || {}; - const config = entry.config || {}; - config.managedMonitor = binaryPath; - entry.config = config; - entry.enabled = true; - setOpenclawConfig(`plugins.entries.${PLUGIN_NAME}`, entry); + const managedMonitorKey = `plugins.entries.${PLUGIN_NAME}.config.managedMonitor`; + if (getOpenclawConfig(managedMonitorKey, undefined) === undefined) { + setOpenclawConfig(managedMonitorKey, binaryPath); + } logOk(`managedMonitor configured → ${binaryPath}`); }