forked from di-sukharev/opencommit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.ts
More file actions
14 lines (13 loc) · 378 Bytes
/
Copy pathversion.ts
File metadata and controls
14 lines (13 loc) · 378 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { outro } from '@clack/prompts';
import { execa } from 'execa';
export const getOpenCommitLatestVersion = async (): Promise<
string | undefined
> => {
try {
const { stdout } = await execa('npm', ['view', 'opencommit', 'version']);
return stdout;
} catch (_) {
outro('Error while getting the latest version of opencommit');
return undefined;
}
};