From cd3eab5d351b84193a3e9d8a90d8fcf8146e83e8 Mon Sep 17 00:00:00 2001 From: whyour Date: Thu, 10 Nov 2022 01:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/system.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/back/api/system.ts b/back/api/system.ts index e7ce2e0d..467ad00c 100644 --- a/back/api/system.ts +++ b/back/api/system.ts @@ -25,13 +25,15 @@ export default (app: Router) => { const currentVersionFile = fs.readFileSync(config.versionFile, 'utf8'); const version = currentVersionFile.match(versionRegx)![1]; const lastCommitTime = ( - await promiseExec('git show -s --format=%ai') + await promiseExec(`cd ${config.rootPath} && git show -s --format=%ai`) ).replace('\n', ''); const lastCommitId = ( - await promiseExec('git rev-parse --short HEAD') + await promiseExec(`cd ${config.rootPath} && git rev-parse --short HEAD`) ).replace('\n', ''); const branch = ( - await promiseExec('git symbolic-ref --short HEAD') + await promiseExec( + `cd ${config.rootPath} && git symbolic-ref --short HEAD`, + ) ).replace('\n', ''); let isInitialized = true;