toplenboren / simple-git-hooks

A simple git hooks manager for small projects
MIT License
1.34k stars 43 forks source link

Fix some minor issues in recognition and loading of custom configs #72

Closed TomerAberbach closed 2 years ago

TomerAberbach commented 2 years ago

The two issues:

  1. The logic for finding the custom config command line argument would not work for all cases. In some cases the name of the binary would be the full path to cli.js so the check for 'simple-git-hooks' wouldn't work. It's sufficient to assume the config file path will always be at index 2.
  2. The config file loader assumes that the given path is relative to the project directory, but this isn't necessarily the case for a custom config path (I could provide it as an absolute path). I fixed this by checking whether the path is already absolute.
toplenboren commented 2 years ago

Thank you for this PR 🚀

Gonna include it into release ...

TomerAberbach commented 2 years ago

@toplenboren any chance the next version could be released soon? I'm currently relying on my fork for the fix.