From 429bb2d6901a520f46ef9c38dc03537cd98b706c Mon Sep 17 00:00:00 2001 From: stratumadev Date: Fri, 28 Nov 2025 22:22:00 +0100 Subject: [PATCH] fix(args): resolve issue with short flag parsing in overrideArguments function --- index.ts | 4 ---- modules/module.app-args.ts | 4 ++-- pnpm-lock.yaml | 8 ++++---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/index.ts b/index.ts index 2be257b..dabd69b 100644 --- a/index.ts +++ b/index.ts @@ -52,10 +52,6 @@ const SERVICES: Record = { const ids = makeCommand(argv.service); for (const id of ids) { overrideArguments(cfg.cli, id); - /* Reimport module to override appArgv */ - // Object.keys(require.cache).forEach((key) => { - // if (key.endsWith('crunchy.js') || key.endsWith('hidive.js')) delete require.cache[key]; - // }); const Service = SERVICES[argv.service]; if (!Service) { console.error('Unknown service:', argv.service); diff --git a/modules/module.app-args.ts b/modules/module.app-args.ts index abf63e0..3fbb988 100644 --- a/modules/module.app-args.ts +++ b/modules/module.app-args.ts @@ -182,9 +182,9 @@ const overrideArguments = (cfg: { [key: string]: unknown }, override: Partial 1 ? `--${key}` : `-${key}`); } else { - baseArgv.push(`--${key}`, String(val)); + baseArgv.push(key.length > 1 ? `--${key}` : `-${key}`, String(val)); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc19162..48f5622 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -406,8 +406,8 @@ packages: resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@3.3.1': - resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} + '@eslint/eslintrc@3.3.3': + resolution: {integrity: sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/js@9.39.1': @@ -2219,7 +2219,7 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.1': + '@eslint/eslintrc@3.3.3': dependencies: ajv: 6.12.6 debug: 4.4.3 @@ -2866,7 +2866,7 @@ snapshots: '@eslint/config-array': 0.21.1 '@eslint/config-helpers': 0.4.2 '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.1 + '@eslint/eslintrc': 3.3.3 '@eslint/js': 9.39.1 '@eslint/plugin-kit': 0.4.1 '@humanfs/node': 0.16.7