From 9c3fc9f75a23ca99fdee2f632ec8718e702640b3 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com> Date: Wed, 23 Mar 2022 12:33:47 -0700 Subject: [PATCH] Update frontend git commit hash logic --- frontend/generate-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/generate-config.js b/frontend/generate-config.js index 617ab3c0e..1f37953b7 100644 --- a/frontend/generate-config.js +++ b/frontend/generate-config.js @@ -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');