From dcc23e7e43dbc2cf46e1ba2eea009a8e61db46b7 Mon Sep 17 00:00:00 2001 From: xiongxiao Date: Sun, 29 Mar 2026 01:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=8C=E6=AD=A5=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E6=95=B0=E6=8D=AE=E7=9A=84=E6=88=90=E5=8A=9F=E6=97=A5?= =?UTF-8?q?=E5=BF=97=EF=BC=9B=E6=9B=B4=E6=96=B0=20CLI=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E5=90=8C=E6=AD=A5=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/routes/cnb.ts | 2 +- src/routes/sync.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a82494b..62b7329 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "cli": "bun run src/cli.ts " + "cli": "bun run src/cli.ts ", + "sync": "bun run src/cli.ts repo sync" }, "keywords": [], "author": "abearxiong (https://www.xiongxiao.me)", diff --git a/src/routes/cnb.ts b/src/routes/cnb.ts index 5309d2d..238fdae 100644 --- a/src/routes/cnb.ts +++ b/src/routes/cnb.ts @@ -36,7 +36,7 @@ app.route({ updatedAt: dayjs(item.updated_at).format('YYYY-MM-DD HH:mm:ss'), })) const repositories = _todayList.filter(item => item.topics.includes('gitea')); - if (_todayList.length > 5) { + if (_todayList.length >= 1) { app.run({ path: 'cnb', key: 'report', payload: { repoList: _todayList } }); } ctx.body = { diff --git a/src/routes/sync.ts b/src/routes/sync.ts index a5c977e..d5f9eb5 100644 --- a/src/routes/sync.ts +++ b/src/routes/sync.ts @@ -73,6 +73,7 @@ const sync = async (repo: Repo) => { execSync(`git pull origin main`, { cwd }); // 推送到gitea execSync(`git push gitea main`, { cwd }); + console.log(`同步推送 ${repo.path} 成功`); } catch (err) { console.error(`同步推送 ${repo.path} 失败`, repo); }