mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
23 lines
397 B
Bash
Executable file
23 lines
397 B
Bash
Executable file
#!/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 -a -m "Release $1" \
|
|
&& git push \
|
|
&& git push --tags \
|
|
&& hook post-release \
|
|
&& echo "... complete"
|
|
else
|
|
echo "tag required" 1>&2 && exit 1
|
|
fi
|