Is there a hack for a fully functional cross-platform shebang line?

Problem: obviously, the scripts in the .git / hooks directory depend on the file name corresponding to one of:

post-commit
pre-commit
pre-rebase

etc.

No concept of "file extension" is required because the "shebang line" indicates how the file should work if it runs and runs in your Linux field.

The problem is that you have scripts that you want to run in a Windows window.

Question: Is there a way to execute hook scripts that can be understood on a Windows computer?

+3
source share
3 answers

, Windows . : 1) Cygwin git bash, shebang, 2) Windows git, shebang . , , ...

+1

, , . python, ".py" PATHEXT (Control Panel, System, Advanced, Environment Variables). . hooks post-commit.py, pre-commit.py .. Windows post-commit , Windows PATHEXT, , "post-commit.extension", . - svn hooks Windows.

+3

3):

Windows script, git , . , -, , git , hook.

0

Source: https://habr.com/ru/post/1733531/


All Articles