* refactor(cli.ts): call isHookCalled function asynchronously feat(githook.ts): add support for git core hooks path and fallback to default symlink url if not found feat(utils/git.ts): add getCoreHooksPath function to retrieve the path of the core hooks directory. * refactor(githook.ts): remove console.log statement from hookCommand function * feat(prepare-commit-msg-hook.ts): add isStageAllFlag parameter to prepareCommitMessageHook function to stage all changes if flag is true * refactor(githook.ts): use path.join to join path segments instead of string concatenation style(githook.ts): format code with prettier
This commit is contained in:
@@ -25,6 +25,14 @@ export const getOpenCommitIgnore = (): Ignore => {
|
||||
return ig;
|
||||
};
|
||||
|
||||
export const getCoreHooksPath = async(): Promise<string> => {
|
||||
const { stdout } = await execa('git', [
|
||||
'config',
|
||||
'core.hooksPath']);
|
||||
|
||||
return stdout;
|
||||
}
|
||||
|
||||
export const getStagedFiles = async (): Promise<string[]> => {
|
||||
const { stdout: gitDir } = await execa('git', [
|
||||
'rev-parse',
|
||||
|
||||
Reference in New Issue
Block a user