From 3180d961dd1688e0a7de1202f64c2b821f8b8f6f Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Thu, 30 Mar 2023 06:56:44 +0800 Subject: [PATCH] fix: trim git info (#1746) --- apps/web/scripts/gitInfo.mjs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apps/web/scripts/gitInfo.mjs b/apps/web/scripts/gitInfo.mjs index 51ea7d5127..1e44da0847 100644 --- a/apps/web/scripts/gitInfo.mjs +++ b/apps/web/scripts/gitInfo.mjs @@ -27,15 +27,10 @@ const getGitVersion = () => { ); return null; } - const VERSION = execSync('git describe --always --dirty') - .toString() - // remove empty line - .replace(/[\s\r\n]+$/, ''); - - return VERSION; + return execSync('git describe --always --dirty').toString().trimEnd(); }; const getCommitHash = (rev = 'HEAD') => - execSync(`git rev-parse --short ${rev}`).toString(); + execSync(`git rev-parse --short ${rev}`).toString().trimEnd(); export { getCommitHash, getGitVersion };