awslabs / git-secrets

Prevents you from committing secrets and credentials into git repositories
Apache License 2.0
12.36k stars 1.17k forks source link

Would it be possible for install to use full path to git-secrets? #183

Open agibralter opened 3 years ago

agibralter commented 3 years ago

https://github.com/awslabs/git-secrets/blob/master/git-secrets#L206

There at least a few IDEs/editors (JetBrains RubyMine, VS Code) that choke on the git hooks that get installed. If you try to commit from within the IDE's git interface, it blows up and says: image

This is because the IDE runs git with some sort of weird setting for $PATH. For example, RubyMine seems to run it's git executable with the following $PATH: /usr/local/Cellar/git/2.28.0/libexec/git-core:/usr/bin:/bin:/usr/sbin:/sbin while git-secrets is at /usr/local/bin/git-secrets (brew install git-secrets)...

Would it be possible or make sense for the install script to use the absolute path itself?

sparr commented 1 year ago

git secrets will only ever check the current path for the git-secrets script; git-secrets and its install process has no control over that.

However, make install does allow you to specify an alternate install location. You might try PREFIX=/usr make install which will put the script in a place that your IDE's path can see it.