fix(core): Fix logging mechanism on existing package version check

This commit is contained in:
Philipp Kunz 2024-10-23 15:59:26 +02:00
parent 5922249742
commit a7c631bba1
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,10 @@
# Changelog # 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) ## 2024-10-23 - 1.3.2 - fix(core)
Corrected file patterns in dynamically created package.json files. Corrected file patterns in dynamically created package.json files.

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@git.zone/tspublish', 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.' description: 'A tool to publish multiple, concise, and small packages from monorepos, specifically for TypeScript projects within a git environment.'
} }

View File

@ -61,9 +61,8 @@ export class PublishModule {
const availableVersions = packageInfo.allVersions.map((versionArg) => versionArg.version); const availableVersions = packageInfo.allVersions.map((versionArg) => versionArg.version);
logger.log('info', `available versions are: ${availableVersions.toString()}`); logger.log('info', `available versions are: ${availableVersions.toString()}`);
if (availableVersions.includes(this.options.version)) { if (availableVersions.includes(this.options.version)) {
throw new Error( logger.log('error', `package ${this.options.name} already exists with version ${this.options.version}`);
`package ${this.options.name} already exists with version ${this.options.version}` process.exit(1);
);
} }
} }
} }