fix: only fill missing plugin config values
This commit is contained in:
@@ -368,14 +368,21 @@ async function configure() {
|
|||||||
}
|
}
|
||||||
logOk(`plugins.allow includes ${PLUGIN_NAME}`);
|
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') {
|
if (options.installMonitor === 'yes') {
|
||||||
const binaryPath = join(openclawPath, 'plugins', PLUGIN_NAME, 'bin', 'HarborForge.Monitor');
|
const binaryPath = join(openclawPath, 'plugins', PLUGIN_NAME, 'bin', 'HarborForge.Monitor');
|
||||||
const entry = getOpenclawConfig(`plugins.entries.${PLUGIN_NAME}`, {}) || {};
|
const managedMonitorKey = `plugins.entries.${PLUGIN_NAME}.config.managedMonitor`;
|
||||||
const config = entry.config || {};
|
if (getOpenclawConfig(managedMonitorKey, undefined) === undefined) {
|
||||||
config.managedMonitor = binaryPath;
|
setOpenclawConfig(managedMonitorKey, binaryPath);
|
||||||
entry.config = config;
|
}
|
||||||
entry.enabled = true;
|
|
||||||
setOpenclawConfig(`plugins.entries.${PLUGIN_NAME}`, entry);
|
|
||||||
logOk(`managedMonitor configured → ${binaryPath}`);
|
logOk(`managedMonitor configured → ${binaryPath}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user