Compare commits

...

3 Commits

Author SHA1 Message Date
di-sukharev
b6651a4c47 1.1.42 2023-04-05 12:36:13 +08:00
di-sukharev
2b10dc089c refactor(githook.ts): remove unused platform variable and switch statement
fix(githook.ts): change DEFAULT_SYMLINK_URL to use relative path instead of absolute path
2023-04-05 12:35:23 +08:00
di-sukharev
a5e60ac23c 1.1.41 2023-04-05 12:32:13 +08:00
3 changed files with 4 additions and 26 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "opencommit",
"version": "1.1.40",
"version": "1.1.42",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "opencommit",
"version": "1.1.40",
"version": "1.1.42",
"license": "MIT",
"dependencies": {
"@clack/prompts": "^0.6.1",

View File

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

View File

@@ -7,30 +7,8 @@ import chalk from 'chalk';
import { intro, outro } from '@clack/prompts';
import { COMMANDS } from '../CommandsEnum.js';
const platform = process.platform;
let separator = '';
switch (platform) {
// Windows
case 'win32':
separator = path.sep;
break;
// macOS
case 'darwin':
separator = '';
break;
// Linux and Android
case 'android':
case 'linux':
separator = '';
break;
default:
throw new Error(`Unsupported platform: ${platform}`);
}
const HOOK_NAME = 'prepare-commit-msg';
const DEFAULT_SYMLINK_URL = path.join(separator, '.git', 'hooks', HOOK_NAME);
const DEFAULT_SYMLINK_URL = path.join('.git', 'hooks', HOOK_NAME);
const getHooksPath = async (): Promise<string> => {
try {