Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:17
Show Gist options
  • Save ezhov-da/6f2d06bb9a6ebdf0ff0b471384232153 to your computer and use it in GitHub Desktop.
Save ezhov-da/6f2d06bb9a6ebdf0ff0b471384232153 to your computer and use it in GitHub Desktop.
git hooks groovy
Для того, чтоб использовать 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