Improve server version logging info

- Capture commit date and print that next to the branch
- Info for being on a dev branch
- Info for not being on the latest commit (fetch should've gotten it, if update script was run)
This commit is contained in:
Wolfsblvt
2024-04-02 22:17:21 +02:00
parent f9e74ea9bf
commit 514c40228c
2 changed files with 26 additions and 5 deletions

View File

@ -475,7 +475,18 @@ const autorunUrl = new URL(
const setupTasks = async function () {
const version = await getVersion();
console.log(`SillyTavern ${version.pkgVersion}` + (version.gitBranch ? ` '${version.gitBranch}' (${version.gitRevision})` : ''));
// Print formatted header
console.log();
console.log(`SillyTavern ${version.pkgVersion}`);
console.log(version.gitBranch ? `Running '${version.gitBranch}' (${version.gitRevision}) - ${version.commitDate}` : '');
if (version.gitBranch && !['staging', 'release'].includes(version.gitBranch)) {
console.log('INFO: Currently running a dev branch.');
console.log(` If this isn't a dev environment, consider switching via 'git switch staging' or 'git switch release'.`);
} else if (version.gitBranch && !version.isLatest) {
console.log('INFO: Currently not on the latest commit.');
console.log(` Run 'git pull' to upate. If you have any conflicts, run 'git reset --hard' and 'git pull' to reset your branch.`)
}
console.log();
// TODO: do endpoint init functions depend on certain directories existing or not existing? They should be callable
// in any order for encapsulation reasons, but right now it's unknown if that would break anything.