javascript - Modifying files in pre-commit hook without having to restage them -


i started use pre-commit hook in project, in script run grunt tasks jshint , jsbeautifier.

the thing jsbeautifier modify files, when does, have restage modified files.

would possible have stage files once?

as commented, nothing prevents script add modified files.

you can add type of files:

git ls-files [path] | grep '\.js$' | xargs git add 

a pre-commit hook jish/pre-commit (presented here) includes staging step (in lib/pre-commit/utils/staged_files.rb).


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -