* 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:
+10
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user