新增同步仓库数据的成功日志;更新 CLI 脚本以支持同步命令
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"cli": "bun run src/cli.ts "
|
"cli": "bun run src/cli.ts ",
|
||||||
|
"sync": "bun run src/cli.ts repo sync"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ app.route({
|
|||||||
updatedAt: dayjs(item.updated_at).format('YYYY-MM-DD HH:mm:ss'),
|
updatedAt: dayjs(item.updated_at).format('YYYY-MM-DD HH:mm:ss'),
|
||||||
}))
|
}))
|
||||||
const repositories = _todayList.filter(item => item.topics.includes('gitea'));
|
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 } });
|
app.run({ path: 'cnb', key: 'report', payload: { repoList: _todayList } });
|
||||||
}
|
}
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ const sync = async (repo: Repo) => {
|
|||||||
execSync(`git pull origin main`, { cwd });
|
execSync(`git pull origin main`, { cwd });
|
||||||
// 推送到gitea
|
// 推送到gitea
|
||||||
execSync(`git push gitea main`, { cwd });
|
execSync(`git push gitea main`, { cwd });
|
||||||
|
console.log(`同步推送 ${repo.path} 成功`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`同步推送 ${repo.path} 失败`, repo);
|
console.error(`同步推送 ${repo.path} 失败`, repo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user