fix: trim git info (#1746)
This commit is contained in:
@@ -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 };
|
||||||
|
|||||||
Reference in New Issue
Block a user