From 52c0db24d3b23b9de380acb0bb6626d6c409d928 Mon Sep 17 00:00:00 2001 From: chjs <461646668@qq.com> Date: Wed, 5 Aug 2026 11:50:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E6=9E=90=20wrangler=20stdout?= =?UTF-8?q?=20=E6=97=B6=E5=BF=BD=E7=95=A5=E4=BB=A3=E7=90=86=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=A1=8C=EF=BC=8C=E9=81=BF=E5=85=8D=20JSON.parse=20?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/setup-kv.cjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/setup-kv.cjs b/scripts/setup-kv.cjs index 1f1ff8ea..5c46be0f 100644 --- a/scripts/setup-kv.cjs +++ b/scripts/setup-kv.cjs @@ -18,7 +18,8 @@ function run(command) { function listNamespaces() { const output = run('npx wrangler kv namespace list'); - const parsed = JSON.parse(output); + const start = output.indexOf('['); + const parsed = start === -1 ? [] : JSON.parse(output.slice(start)); return Array.isArray(parsed) ? parsed : []; }