observing / pre-commit

Automatically installs a git pre-commit script in your git repository which runs your `npm test` on pre-commit
MIT License
1.88k stars 150 forks source link

Use system-neutral /usr/bin/env bash instead of /bin/bash #87

Open charud opened 7 years ago

charud commented 7 years ago

Is there a reason that #!/bin/bash is used here https://github.com/observing/pre-commit/blob/7154dee93f2c38ef46f807f21cc9ce73848d7396/hook#L1 instead of #!/usr/bin/env bash which would avoid the error error: cannot run .git/hooks/pre-commit: No such file or directory that users could get who does not have bash in /bin.

Has there been any discussion around this?

gilligan commented 7 years ago

I wanted to suggest the same - I am using NixOS and I do not have a /bin/bash at all. I would suggest to just us /bin/sh because that is the bare minimum which always has exist.

vith commented 7 years ago

Same problem here on NixOS.

A PR to fix this has been opened at #105 by @tassmjau.

ItsDrike commented 1 month ago

So, it seems that this has been fixed in the source code (that PR is now merged), but there wasn't a new release made in 8 years, so it's still not on NPM... Could a new release be made?