blob: 023e5d4dd04300c99d21a897b7e45a0883ab87a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/env bash
# git hook to make sure you check out the current core version before committing
# to install, place it into your git hook folder with the appropriate name:
#
# cp check-correct-subproject.sh .git/hooks/pre-commit
#
# OR (to check a bit earlier)
#
# cp check-correct-subproject.sh .git/hooks/prepare-commit-msg
#
currentMainProject="$(git show :versions/mainProject|tr -d '\n')"
currentMainVersion="$(git show :mainProject|tr -d '\n')"
if [ "x$currentMainVersion" != "x$currentMainProject" ]; then
echo "Currently checked out version is $currentMainProject, but $currentMainVersion should be committed."
echo "Run ./gradlew :${currentMainVersion}:setCoreVersion to fix"
echo
exit 1
else
echo "Correct core version $currentMainVersion checked out"
fi
|