mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
fix(githook.ts): fix SYMLINK_URL for Windows (#88)
* fix(githook.ts): fix SYMLINK_URL for Windows * refactor(githook.ts): use path.join to create SYMLINK_URL The SYMLINK_URL variable is now created using the path.join method, which is more platform-independent and ensures that the correct path separator is used. This improves the reliability of the code and makes it easier to maintain. --------- Co-authored-by: Maik Stegemann <ms@lis-gmbh.com>
This commit is contained in:
@@ -8,9 +8,9 @@ import { intro, outro } from '@clack/prompts';
|
||||
import { COMMANDS } from '../CommandsEnum.js';
|
||||
|
||||
const HOOK_NAME = 'prepare-commit-msg';
|
||||
const SYMLINK_URL = `.git/hooks/${HOOK_NAME}`;
|
||||
const SYMLINK_URL = path.join(path.sep, '.git', 'hooks', HOOK_NAME);
|
||||
|
||||
export const isHookCalled = process.argv[1].endsWith(`/${SYMLINK_URL}`);
|
||||
export const isHookCalled = process.argv[1].endsWith(`${SYMLINK_URL}`);
|
||||
|
||||
const isHookExists = existsSync(SYMLINK_URL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user