修复获取最后commit时间

This commit is contained in:
whyour 2022-11-10 10:52:57 +08:00
parent cd3eab5d35
commit 40bc25ed5f

View File

@ -25,7 +25,7 @@ export default (app: Router) => {
const currentVersionFile = fs.readFileSync(config.versionFile, 'utf8');
const version = currentVersionFile.match(versionRegx)![1];
const lastCommitTime = (
await promiseExec(`cd ${config.rootPath} && git show -s --format=%ai`)
await promiseExec(`cd ${config.rootPath} && git show -s --format=%ai | head -1`)
).replace('\n', '');
const lastCommitId = (
await promiseExec(`cd ${config.rootPath} && git rev-parse --short HEAD`)