Last active
March 10, 2019 12:17
-
-
Save ezhov-da/6f2d06bb9a6ebdf0ff0b471384232153 to your computer and use it in GitHub Desktop.
git hooks groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Для того, чтоб использовать GIT HOOKS на groovy в Windows, необходимо в хуках вызывать скрипт на groovy. | |
Пример: | |
hooks.groovy script: | |
import java.text.SimpleDateFormat | |
File file = new File("E:/hello-from-hook${new SimpleDateFormat("yyy-MM-dd-HH-mm").format(new Date())}.txt") | |
file.write("hello") | |
commit-msg hook: | |
#!/bin/sh | |
E:/java_library/groovy-2.4.12/bin/groovy.bat E:/-my-git-repo-/.git/hooks/hooks.groovy | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment