Fix empty revision case
This commit is contained in:
parent
4bb6f49950
commit
230fbdbc8e
@ -34,10 +34,9 @@ class BackendInfo {
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
const gitRevParse = spawnSync('git', ['rev-parse', '--short', 'HEAD']);
|
const gitRevParse = spawnSync('git', ['rev-parse', '--short', 'HEAD']);
|
||||||
|
|
||||||
if (!gitRevParse.error) {
|
if (!gitRevParse.error) {
|
||||||
this.gitCommitHash = gitRevParse.stdout.toString('utf-8').replace(/[\n\r\s]+$/, '');
|
const output = gitRevParse.stdout.toString('utf-8').replace(/[\n\r\s]+$/, '');
|
||||||
console.log(`mempool revision ${this.gitCommitHash}`);
|
this.gitCommitHash = output ? output : '?';
|
||||||
} else if (gitRevParse.error.code === 'ENOENT') {
|
} else if (gitRevParse.error.code === 'ENOENT') {
|
||||||
console.log('git not found, cannot parse git hash');
|
console.log('git not found, cannot parse git hash');
|
||||||
this.gitCommitHash = '?';
|
this.gitCommitHash = '?';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user