mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Added pre- post-release hooks to git-release
This commit is contained in:
parent
cca7848b5b
commit
c4e938d656
|
|
@ -249,9 +249,11 @@ $ git release 0.1.0
|
|||
|
||||
Does the following:
|
||||
|
||||
- Executes _.git/hooks/pre-release.sh_ (if present)
|
||||
- Commits changes (to changelog etc) with message "Release <tag>"
|
||||
- Tags with the given <tag>
|
||||
- Push the branch / tags
|
||||
- Executes _.git/hooks/post-release.sh_ (if present)
|
||||
|
||||
## git-alias
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,21 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
hook() {
|
||||
local hook=.git/hooks/$1.sh
|
||||
if test -f $hook; then
|
||||
echo "... $1"
|
||||
. $hook
|
||||
fi
|
||||
}
|
||||
|
||||
if test $# -gt 0; then
|
||||
hook pre-release
|
||||
echo "... releasing $1"
|
||||
git commit -a -m "Release $1" \
|
||||
&& git tag $1 \
|
||||
&& git push \
|
||||
&& git push --tags \
|
||||
&& hook post-release \
|
||||
&& echo "... complete"
|
||||
else
|
||||
echo "tag required" && exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue