Compare commits

...

6 Commits

Author SHA1 Message Date
di-sukharev
91987030f0 1.0.12 2023-03-11 00:15:34 +08:00
di-sukharev
2a55b08b51 * refactor(api.ts): remove redundant code block and process.exit(1) call 2023-03-11 00:15:17 +08:00
di-sukharev
ed4d6e0109 1.0.11 2023-03-10 22:49:43 +08:00
di-sukharev
6712e798c5 * feat(cli.ts): add check for new opencommit version after commit is made
* chore(cli.ts): import execa and outro from their respective packages
2023-03-10 22:49:27 +08:00
di-sukharev
1347962a93 1.0.10 2023-03-10 22:42:33 +08:00
di-sukharev
3ca9b9752f * fix(api.ts): add process.exit(1) to terminate the process if apiKey is not provided 2023-03-10 22:41:53 +08:00
3 changed files with 14 additions and 6 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "open-commit", "name": "open-commit",
"version": "1.0.9", "version": "1.0.12",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "open-commit", "name": "open-commit",
"version": "1.0.9", "version": "1.0.12",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@clack/prompts": "^0.6.1", "@clack/prompts": "^0.6.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "opencommit", "name": "opencommit",
"version": "1.0.9", "version": "1.0.12",
"description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫", "description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
"keywords": [ "keywords": [
"git", "git",

View File

@@ -7,6 +7,8 @@ import { configCommand } from './commands/config';
import { hookCommand, isHookCalled } from './commands/githook.js'; import { hookCommand, isHookCalled } from './commands/githook.js';
import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook'; import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook';
import { commit } from './commands/commit'; import { commit } from './commands/commit';
import { execa } from 'execa';
import { outro } from '@clack/prompts';
const rawArgv = process.argv.slice(2); const rawArgv = process.argv.slice(2);
@@ -19,11 +21,17 @@ cli(
ignoreArgv: (type) => type === 'unknown-flag' || type === 'argument', ignoreArgv: (type) => type === 'unknown-flag' || type === 'argument',
help: { description: packageJSON.description } help: { description: packageJSON.description }
}, },
() => { async () => {
if (isHookCalled) { if (isHookCalled) {
prepareCommitMessageHook(); await prepareCommitMessageHook();
} else { } 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 rawArgv