From 8cf016f0d8380ee1535ffae959d71f97373b2787 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 28 Oct 2025 19:17:11 +0000 Subject: [PATCH] fix(cli): Fallback to unknown when script.slug is missing in scripts list --- changelog.md | 7 +++++++ ts/00_commitinfo_data.ts | 2 +- ts/moxytool.cli.ts | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 8557dff..f2b21e0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-10-28 - 1.4.1 - fix(cli) +Fallback to 'unknown' when script.slug is missing in scripts list + +- Fixes a potential runtime error when listing scripts if a script entry lacks a slug +- Uses a safe fallback ('unknown') before calling padEnd to ensure stable output +- Modified file: ts/moxytool.cli.ts + ## 2025-10-28 - 1.4.0 - feat(cli) Improve CLI output and logging with colored header, grouped script listings, and ANSI-styled logger diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index d13a1fa..f880528 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/moxytool', - version: '1.4.0', + version: '1.4.1', description: 'Proxmox administration tool for vGPU setup, VM management, and cluster configuration' } diff --git a/ts/moxytool.cli.ts b/ts/moxytool.cli.ts index 96004a9..74462f2 100644 --- a/ts/moxytool.cli.ts +++ b/ts/moxytool.cli.ts @@ -273,7 +273,8 @@ export const runCli = async () => { if (otherScripts.length > 0) { logger.log('info', 'Other:'); otherScripts.forEach(script => { - logger.log('info', ` • ${script.slug.padEnd(25)} - ${script.name} (${script.type})`); + const slug = script.slug || 'unknown'; + logger.log('info', ` • ${slug.padEnd(25)} - ${script.name} (${script.type})`); }); }