mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-13 07:38:01 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91987030f0 | ||
|
|
2a55b08b51 | ||
|
|
ed4d6e0109 | ||
|
|
6712e798c5 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "open-commit",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.12",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "open-commit",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.12",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^0.6.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "opencommit",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.12",
|
||||
"description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
|
||||
"keywords": [
|
||||
"git",
|
||||
|
||||
@@ -20,7 +20,6 @@ if (!apiKey) {
|
||||
outro(
|
||||
'For help Look into README https://github.com/di-sukharev/opencommit#setup'
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// if (!apiKey) {
|
||||
|
||||
14
src/cli.ts
14
src/cli.ts
@@ -7,6 +7,8 @@ import { configCommand } from './commands/config';
|
||||
import { hookCommand, isHookCalled } from './commands/githook.js';
|
||||
import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook';
|
||||
import { commit } from './commands/commit';
|
||||
import { execa } from 'execa';
|
||||
import { outro } from '@clack/prompts';
|
||||
|
||||
const rawArgv = process.argv.slice(2);
|
||||
|
||||
@@ -19,11 +21,17 @@ 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