Skip to content

Commit

Permalink
fixes script log
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Sep 27, 2024
1 parent f916536 commit 0461a97
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions misc/version-helper.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { writeFileSync } from 'fs';
import { yellow, red, green, cyan } from 'colors';
import { ISDKInfo } from '@kontent-ai/core-sdk';
import { cyan, green, red, yellow } from 'colors';
import { writeFileSync } from 'fs';

export const verifySdkVersion = (sdkInfo: ISDKInfo, versionInPackage: string) => {
if (sdkInfo.version !== versionInPackage) {
const msg = `Versions of '${sdkInfo.name}' SDK don't match. Lib version is '${sdkInfo.version}' while package version is '${versionInPackage}'.
Please make sure to use identical versions.`;
throw Error(red(msg));
} else {
console.log(
`Version check successful for '$.yellow(sdkInfo.version)}' and package '$.yellow(
sdkInfo.name
)}'`
);
console.log(`Version check successful for '${yellow(sdkInfo.version)}' and package '${yellow(sdkInfo.name)}'`);
}
};

Expand Down

0 comments on commit 0461a97

Please sign in to comment.