* chore(TODO.md): mark "show new version available message" as completed

* chore(package.json): add `--tag latest` flag to `npm publish` command in `deploy` script
* refactor(cli.ts): add async/await to `prepareCommitMessageHook` and `commit` functions, and check for new version of `opencommit` after commit is made
This commit is contained in:
di-sukharev
2023-03-11 00:57:48 +08:00
parent f49f1a86df
commit 69f3c48b2c
3 changed files with 12 additions and 5 deletions
+10 -3
View File
@@ -21,11 +21,18 @@ cli(
ignoreArgv: (type) => type === 'unknown-flag' || type === 'argument',
help: { description: packageJSON.description }
},
() => {
async () => {
if (isHookCalled) {
prepareCommitMessageHook();
await prepareCommitMessageHook();
} else {
commit();
await commit();
const { stdout } = await execa('npm', ['view', 'opencommit', 'version']);
if (stdout !== packageJSON.version) {
outro(
'new opencommit version is available, update with `npm i -g opencommit`'
);
}
}
},
rawArgv