fix(cli, systemd): Adjust log formatting for consistent output in CLI and systemd commands

This commit is contained in:
2025-03-26 18:08:43 +00:00
parent 9859a02ea2
commit 459911fe5f
4 changed files with 13 additions and 7 deletions

View File

@@ -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