feat(core): Add update checking and version logging across startup components

This commit is contained in:
2025-03-25 09:27:44 +00:00
parent 32f85aa46f
commit 8ee21ea92b
6 changed files with 190 additions and 1 deletions

View File

@@ -152,6 +152,21 @@ export class NupstDaemon {
await this.loadConfig();
this.logConfigLoaded();
// Log version information
this.snmp.getNupst().logVersionInfo(false); // Don't check for updates immediately on startup
// Check for updates in the background
this.snmp.getNupst().checkForUpdates().then(updateAvailable => {
if (updateAvailable) {
const updateStatus = this.snmp.getNupst().getUpdateStatus();
console.log('┌─ Update Available ───────────────────────┐');
console.log(`│ Current Version: ${updateStatus.currentVersion}`);
console.log(`│ Latest Version: ${updateStatus.latestVersion}`);
console.log('│ Run "sudo nupst update" to update');
console.log('└──────────────────────────────────────────┘');
}
}).catch(() => {}); // Ignore errors checking for updates
// Start UPS monitoring
this.isRunning = true;
await this.monitor();