mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91987030f0 | ||
|
|
2a55b08b51 | ||
|
|
ed4d6e0109 | ||
|
|
6712e798c5 | ||
|
|
1347962a93 | ||
|
|
3ca9b9752f |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
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 { 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
|
||||||
|
|||||||
Reference in New Issue
Block a user