mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 17:58:28 +00:00
refactor(cli): share npm install metadata helpers
This commit is contained in:
21
src/cli/plugins-config.ts
Normal file
21
src/cli/plugins-config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
export function setPluginEnabledInConfig(
|
||||
config: OpenClawConfig,
|
||||
pluginId: string,
|
||||
enabled: boolean,
|
||||
): OpenClawConfig {
|
||||
return {
|
||||
...config,
|
||||
plugins: {
|
||||
...config.plugins,
|
||||
entries: {
|
||||
...config.plugins?.entries,
|
||||
[pluginId]: {
|
||||
...(config.plugins?.entries?.[pluginId] as object | undefined),
|
||||
enabled,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user