Server logging utilize tracking branch

- Use tracking branch instead of hardcoded "origin"
- Remove dev logging message if not on "staging" or "release"
This commit is contained in:
Wolfsblvt
2024-04-02 22:51:43 +02:00
parent 514c40228c
commit 3ccb63dd21
2 changed files with 4 additions and 5 deletions

View File

@ -92,9 +92,11 @@ async function getVersion() {
gitBranch = await git.cwd(cwd).revparse(['--abbrev-ref', 'HEAD']);
commitDate = await git.cwd(cwd).show(['-s', '--format=%ci', gitRevision]);
const trackingBranch = await git.cwd(cwd).revparse(['--abbrev-ref', '@{u}']);
// Might fail, but exception is caught. Just don't run anything relevant after in this block...
const localLatest = await git.cwd(cwd).revparse(['HEAD']);
const remoteLatest = await git.cwd(cwd).revparse([`origin/${gitBranch}`]);
const remoteLatest = await git.cwd(cwd).revparse([trackingBranch]);
isLatest = localLatest === remoteLatest;
}
}