Update frontend git commit hash logic

This commit is contained in:
Felipe Knorr Kuhn 2022-03-23 12:33:47 -07:00
parent 230fbdbc8e
commit 9c3fc9f75a
No known key found for this signature in database
GPG key ID: 79619B52BB097C1A

View file

@ -51,9 +51,9 @@ if (process.env.DOCKER_COMMIT_HASH) {
} else {
try {
const gitRevParse = spawnSync('git', ['rev-parse', '--short', 'HEAD']);
if (!gitRevParse.error) {
gitCommitHash = gitRevParse.stdout.toString('utf-8').replace(/[\n\r\s]+$/, '');
const output = gitRevParse.stdout.toString('utf-8').replace(/[\n\r\s]+$/, '');
gitCommitHash = output ? output : '?';
console.log(`mempool revision ${gitCommitHash}`);
} else if (gitRevParse.error.code === 'ENOENT') {
console.log('git not found, cannot parse git hash');