From a7c631bba1e875f7fe7310564e165c666750b7e4 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 23 Oct 2024 15:59:26 +0200 Subject: [PATCH] fix(core): Fix logging mechanism on existing package version check --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.publishmodule.ts | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 47532ea..ec94982 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-10-23 - 1.3.3 - fix(core) +Fix logging mechanism on existing package version check + +- Changed the error handling mechanism when a package with the same version already exists to use logger and process exit instead of throwing an error. + ## 2024-10-23 - 1.3.2 - fix(core) Corrected file patterns in dynamically created package.json files. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index bb4b7b6..9b71fea 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tspublish', - version: '1.3.2', + version: '1.3.3', description: 'A tool to publish multiple, concise, and small packages from monorepos, specifically for TypeScript projects within a git environment.' } diff --git a/ts/classes.publishmodule.ts b/ts/classes.publishmodule.ts index 41bb6a5..4008e52 100644 --- a/ts/classes.publishmodule.ts +++ b/ts/classes.publishmodule.ts @@ -61,9 +61,8 @@ export class PublishModule { const availableVersions = packageInfo.allVersions.map((versionArg) => versionArg.version); logger.log('info', `available versions are: ${availableVersions.toString()}`); if (availableVersions.includes(this.options.version)) { - throw new Error( - `package ${this.options.name} already exists with version ${this.options.version}` - ); + logger.log('error', `package ${this.options.name} already exists with version ${this.options.version}`); + process.exit(1); } } }