fix: trim git info (#1746)

This commit is contained in:
Fangdun Tsai authored and GitHub committed 2023-03-29 17:56:44 -05:00
1 parent 926bf49b26
commit 3180d961dd
1 file changed
+2 -7
+2 -7
View File
@@ -27,15 +27,10 @@ const getGitVersion = () => {
); );
return null; return null;
} }
const VERSION = execSync('git describe --always --dirty') return execSync('git describe --always --dirty').toString().trimEnd();
.toString()
// remove empty line
.replace(/[\s\r\n]+$/, '');
return VERSION;
}; };
const getCommitHash = (rev = 'HEAD') => const getCommitHash = (rev = 'HEAD') =>
execSync(`git rev-parse --short ${rev}`).toString(); execSync(`git rev-parse --short ${rev}`).toString().trimEnd();
export { getCommitHash, getGitVersion }; export { getCommitHash, getGitVersion };