






















@@ -26,7 +26,7 @@ function writeFakeCrabbox(binDir: string, helpText: string): string {
2626" process.stderr.write('config unavailable\\n');",
2727" process.exit(status);",
2828" }",
29-" process.stdout.write(process.env.OPENCLAW_FAKE_CRABBOX_CONFIG_JSON || '{\"coordinator\":\"configured-broker\",\"brokerAuth\":\"configured\"}');",
29+' process.stdout.write(process.env.OPENCLAW_FAKE_CRABBOX_CONFIG_JSON || \'{"coordinator":"configured-broker","brokerAuth":"configured"}\');',
3030" process.exit(0);",
3131"}",
3232"const scriptIndex = args.findIndex((arg) => arg === '--script' || arg === '-script');",
@@ -47,6 +47,23 @@ function writeFakeCrabbox(binDir: string, helpText: string): string {
4747` printf "%s" ${shellSingleQuote(helpText)}`,
4848" exit 0",
4949"fi",
50+'if [ "$1" = "config" ] && [ "$2" = "show" ]; then',
51+' for arg in "$@"; do',
52+' if [ "$arg" = "--json" ]; then',
53+' status="${OPENCLAW_FAKE_CRABBOX_CONFIG_STATUS:-0}"',
54+' if [ "$status" != "0" ]; then',
55+' printf "%s\\n" "config unavailable" >&2',
56+' exit "$status"',
57+" fi",
58+' if [ -n "${OPENCLAW_FAKE_CRABBOX_CONFIG_JSON+x}" ]; then',
59+' printf "%s" "$OPENCLAW_FAKE_CRABBOX_CONFIG_JSON"',
60+" else",
61+' printf "%s" "{\\"coordinator\\":\\"configured-broker\\",\\"brokerAuth\\":\\"configured\\"}"',
62+" fi",
63+" exit 0",
64+" fi",
65+" done",
66+"fi",
5067`exec ${shellSingleQuote(process.execPath)} ${shellSingleQuote(helperPath)} "$@"`,
5168].join("\n");
5269writeFileSync(crabboxPath, `${script}\n`, "utf8");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。