feat(checkIsLatestVersion.ts): add outro message from @clack/prompts to warn user about not using the latest stable version of OpenCommit

This commit is contained in:
di-sukharev
2023-05-26 13:11:51 +08:00
parent 5c540abae9
commit a7af55df37
+2 -1
View File
@@ -1,6 +1,7 @@
import { getOpenCommitLatestVersion } from '../api'; import { getOpenCommitLatestVersion } from '../api';
import currentPackage from '../../package.json' assert { type: 'json' }; import currentPackage from '../../package.json' assert { type: 'json' };
import chalk from 'chalk'; import chalk from 'chalk';
import { outro } from '@clack/prompts';
export const checkIsLatestVersion = async () => { export const checkIsLatestVersion = async () => {
const latestVersion = await getOpenCommitLatestVersion(); const latestVersion = await getOpenCommitLatestVersion();
@@ -9,7 +10,7 @@ export const checkIsLatestVersion = async () => {
const currentVersion = currentPackage.version; const currentVersion = currentPackage.version;
if (currentVersion !== latestVersion) { if (currentVersion !== latestVersion) {
console.warn( outro(
chalk.yellow( chalk.yellow(
` `
You are not using the latest stable version of OpenCommit with new features and bug fixes. You are not using the latest stable version of OpenCommit with new features and bug fixes.