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

solves the windows issue (with symlinks) #84

Closed barroudjo closed 7 years ago

barroudjo commented 7 years ago

Instead of symlinking to the hook in node-modules/pre-commit, this injects a new pre-commit hook (in .git/hooks) that takes care of launching the hook in node-modules/pre-commit. This avoids the whole hassle with symlink creation in windows, which up to now prevented using this module when users could not gain elevated privileges (very frequent in enterprise environments).

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 95.413% when pulling 0d7f290f87976bb1077814b274d0b4660828b34e on barroudjo:solve_windows_issue into 7154dee93f2c38ef46f807f21cc9ce73848d7396 on observing:master.

alallier commented 7 years ago

How does the pre-commit file update on changes made inside of package.json?

barroudjo commented 7 years ago

It doesn't update the pre-commit file, and it didn't either before this pull request. In both cases the pre-commit hook (directly before, indirectly with this pull request) launches the JS script from this module, which itself launches the scripts defined in the "pre-commit" section of your package.json.

alallier commented 7 years ago

Duh yeah okay makes plenty of sense, thanks for the clarification.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 95.413% when pulling 1a662e672031a99f9ce2e8ad8dbc8bf0568f511f on barroudjo:solve_windows_issue into 7154dee93f2c38ef46f807f21cc9ce73848d7396 on observing:master.

barroudjo commented 7 years ago

Can the committers please take a look ? This will make life easier for a lot of people.

okeydoke commented 7 years ago

👍 Could really do with a working solution on windows

ZenGuLhe commented 7 years ago

I very much need this as well, could this be looked at ?

3rd-Eden commented 7 years ago

It's in master, can other windows users confirm that it's working for them? Once I get a few +1's i'll release it.

okeydoke commented 7 years ago

Hey sorry it took so long to get back to you. Just tested master on windows and its working for me now!

okeydoke commented 7 years ago

@3rd-Eden Any idea when release might be?

bryclee commented 7 years ago

On my mac, it looks like the pre-commit file generated is not executable, so the hook isn't firing. Anyone else have this issue? Maybe need to specify mode in options here? https://github.com/observing/pre-commit/pull/84/files#diff-f16acefe4b6553580c43edab685f50f3R68