fix: parse generated plugin manifest metadata safely · openclaw/openclaw@644caea
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { spawnSync } from "node:child_process";
|
2 | 2 | import fs from "node:fs"; |
3 | 3 | import path from "node:path"; |
4 | 4 | import { pathToFileURL } from "node:url"; |
| 5 | +import JSON5 from "json5"; |
5 | 6 | |
6 | 7 | const GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA_PATH = |
7 | 8 | "src/config/bundled-channel-config-metadata.generated.ts"; |
@@ -33,7 +34,7 @@ function readGeneratedBundledChannelConfigs(repoRoot) {
|
33 | 34 | |
34 | 35 | let entries; |
35 | 36 | try { |
36 | | -entries = Function(`"use strict"; return (${match[1]});`)(); |
| 37 | +entries = JSON5.parse(match[1]); |
37 | 38 | } catch { |
38 | 39 | return new Map(); |
39 | 40 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。