开发者

Want Git post receive hook to detect certain file types

开发者 https://www.devze.com 2023-03-05 02:22 出处:网络
I would like my post-receive hook to run a certain script whenever files of a certain type,*.hbm.xml are pushed to the server.

I would like my post-receive hook to run a certain script whenever files of a certain type, *.hbm.xml are pushed to the server. Motivation: I want to rev my database schema version number whenever NHibernate files are c开发者_JAVA百科hanged.

Thanks!


This is what I came up with:

for i in `git show --pretty="format:" --name-only HEAD | grep '.*\.hbm\.xml' `; do
    # call script here.....
    exit
done
0

精彩评论

暂无评论...
验证码 换一张
取 消