Browse Source

Shorten commit hash

pull/1/head
rozetko 6 years ago
parent
commit
ff60ff64ef
  1. 2
      server/src/config.ts

2
server/src/config.ts

@ -75,7 +75,7 @@ function getGitInfo() {
const rev = fs.readFileSync(gitHeadFile).toString(); const rev = fs.readFileSync(gitHeadFile).toString();
let branchPath = rev.indexOf(':') === -1 ? rev : rev.slice(5, -1); let branchPath = rev.indexOf(':') === -1 ? rev : rev.slice(5, -1);
let branch = branchPath.split('/').pop(); let branch = branchPath.split('/').pop();
let commitHash = fs.readFileSync(`${gitRoot}/${branchPath}`).toString().slice(0, -1); let commitHash = fs.readFileSync(`${gitRoot}/${branchPath}`).toString().slice(0, 7);
return { branch, commitHash }; return { branch, commitHash };
} }

Loading…
Cancel
Save