fix: correct routers/rules path resolution

pluginDir already points to the plugin install root, no need for ..

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
zhi
2026-04-18 19:54:20 +00:00
parent d5c057a3f9
commit bee3dcb84c

View File

@@ -38,8 +38,8 @@ export default {
register(api: OpenClawPluginApi) {
const config = normalizeConfig(api);
const pluginDir = path.dirname(new URL(import.meta.url).pathname);
const routersDir = config.routersDir || path.resolve(pluginDir, "..", "routers");
const rulesFile = config.rulesFile || path.resolve(pluginDir, "..", "rules.json");
const routersDir = config.routersDir || path.resolve(pluginDir, "routers");
const rulesFile = config.rulesFile || path.resolve(pluginDir, "rules.json");
// Gateway lifecycle: init once
if (!_G[LIFECYCLE_KEY]) {