git hook script

This commit is contained in:
Wryn Wagner 2021-09-16 11:05:48 -06:00
parent c1d1876b41
commit 6d2043e19f

View File

@ -0,0 +1,15 @@
#!/bin/zsh
git submodule update --remote --rebase --init
SUBMODULES=$(\
git status\
| grep '(new commits)' \
| sed 's/^.*modified:\s*//; s/\s*(new commits).*$//' \
)
[[ ${#SUBMODULES[@]} -gt 0 ]] && {
git add $SUBMODULES
git commit -m "Updated submodules to master : $SUBMODULES"
}