I use the git pre-commit hook to run an autoformat-script format-src.sh
that is based on clang-format
. Some developers use github-desktop
where it is not
easy possible to install the clang-format
package.
For this reason i decided to call cygwin bash from the precommit-hook.
In cygwin it is easy possible to install the clang-format
package with cygwins package manager.
The call of the cygwin shell is done according to: Creating batch file to start cygwin and execute specific command
pre-commit
#!/bin/sh
echo "Format src accordingt to format-src.sh"
CYGWIN_DIR=c:/cygwin64/
PROJ_DIR=/cygdrive/c/Projekte/ExampleProj
eval '$CYGWIN_DIR/bin/mintty $CYGWIN_DIR/bin/bash --login -c "cd $PROJ_DIR; ./format-src.sh"'
My problem ist that the pre-commit hook seems not to wait until the cywin terminal mintty has finished the skript format-src.sh
. Therfore the commit finishes while the auto-formater script still runs.
How can i wait until the the script that runs in mintty has finished ?