mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-12 23:28:16 -05:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af457473be | ||
|
|
33b418e399 | ||
|
|
7e5ed6de0b | ||
|
|
e2f68b7256 | ||
|
|
eacc750952 | ||
|
|
3fe57537ad | ||
|
|
db9cff1ae1 | ||
|
|
1c29b91408 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "opencommit",
|
||||
"version": "1.1.33",
|
||||
"version": "1.1.38",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "opencommit",
|
||||
"version": "1.1.33",
|
||||
"version": "1.1.38",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^0.6.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "opencommit",
|
||||
"version": "1.1.33",
|
||||
"version": "1.1.38",
|
||||
"description": "GPT CLI to auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫",
|
||||
"keywords": [
|
||||
"git",
|
||||
|
||||
@@ -79,6 +79,12 @@ ${chalk.grey('——————————————————')}`
|
||||
|
||||
const remotes = await getGitRemotes();
|
||||
|
||||
if (!remotes.length) {
|
||||
const { stdout } = await execa('git', ['push']);
|
||||
if (stdout) outro(stdout);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (remotes.length === 1) {
|
||||
const isPushConfirmedByUser = await confirm({
|
||||
message: 'Do you want to run `git push`?'
|
||||
|
||||
@@ -7,8 +7,25 @@ import chalk from 'chalk';
|
||||
import { intro, outro } from '@clack/prompts';
|
||||
import { COMMANDS } from '../CommandsEnum.js';
|
||||
|
||||
const platform = process.platform;
|
||||
|
||||
let separator = '';
|
||||
switch (platform) {
|
||||
case 'win32': // Windows
|
||||
separator = path.sep;
|
||||
break;
|
||||
case 'darwin': // macOS
|
||||
separator = '';
|
||||
break;
|
||||
case 'linux': // Linux
|
||||
separator = '';
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unsupported platform: ${platform}`);
|
||||
}
|
||||
|
||||
const HOOK_NAME = 'prepare-commit-msg';
|
||||
const SYMLINK_URL = path.join(path.sep, '.git', 'hooks', HOOK_NAME);
|
||||
const SYMLINK_URL = path.join(separator, '.git', 'hooks', HOOK_NAME);
|
||||
|
||||
export const isHookCalled = process.argv[1].endsWith(`${SYMLINK_URL}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user