fix(cli, systemd): Adjust log formatting for consistent output in CLI and systemd commands
This commit is contained in:
parent
9859a02ea2
commit
459911fe5f
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-03-26 - 2.6.11 - fix(cli, systemd)
|
||||
Adjust log formatting for consistent output in CLI and systemd commands
|
||||
|
||||
- Fixed spacing issues in service installation and status log messages in the systemd module.
|
||||
- Revised output formatting in the CLI to improve message clarity.
|
||||
|
||||
## 2025-03-26 - 2.6.10 - fix(daemon)
|
||||
Adjust console log box formatting for consistent output in daemon status messages
|
||||
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/nupst',
|
||||
version: '2.6.10',
|
||||
version: '2.6.11',
|
||||
description: 'Node.js UPS Shutdown Tool for SNMP-enabled UPS devices'
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ Options:
|
||||
|
||||
if (isActive) {
|
||||
// Service is running, restart it
|
||||
console.log('┌─ Service Update ─────────────────────────┐');
|
||||
console.log('┌─ Service Update ──────────────────────────┐');
|
||||
console.log('│ Configuration has changed.');
|
||||
console.log('│ Restarting NUPST service to apply changes...');
|
||||
|
||||
@ -939,7 +939,7 @@ Options:
|
||||
console.log('│ sudo systemctl restart nupst.service');
|
||||
}
|
||||
|
||||
console.log('└──────────────────────────────────────────┘');
|
||||
console.log('└───────────────────────────────────────────┘');
|
||||
}
|
||||
} catch (error) {
|
||||
// Ignore errors checking service status
|
||||
|
@ -66,7 +66,7 @@ WantedBy=multi-user.target
|
||||
|
||||
// Write the service file
|
||||
await fs.writeFile(this.serviceFilePath, this.serviceTemplate);
|
||||
console.log('┌─ Service Installation ─────────────────────┐');
|
||||
console.log('┌─ Service Installation ──────────────────────┐');
|
||||
console.log(`│ Service file created at ${this.serviceFilePath}`);
|
||||
|
||||
// Reload systemd daemon
|
||||
@ -76,7 +76,7 @@ WantedBy=multi-user.target
|
||||
// Enable the service
|
||||
execSync('systemctl enable nupst.service');
|
||||
console.log('│ Service enabled to start on boot');
|
||||
console.log('└──────────────────────────────────────────┘');
|
||||
console.log('└─────────────────────────────────────────────┘');
|
||||
} catch (error) {
|
||||
if (error.message === 'Configuration not found') {
|
||||
// Just rethrow the error as the message has already been displayed
|
||||
@ -97,9 +97,9 @@ WantedBy=multi-user.target
|
||||
await this.checkConfigExists();
|
||||
|
||||
execSync('systemctl start nupst.service');
|
||||
console.log('┌─ Service Status ─────────────────────────┐');
|
||||
console.log('┌─ Service Status ───────────────────────────┐');
|
||||
console.log('│ NUPST service started successfully');
|
||||
console.log('└──────────────────────────────────────────┘');
|
||||
console.log('└────────────────────────────────────────────┘');
|
||||
} catch (error) {
|
||||
if (error.message === 'Configuration not found') {
|
||||
// Exit with error code since configuration is required
|
||||
|
Loading…
x
Reference in New Issue
Block a user