1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
#!/bin/sh
die() {
echo "(pre-commit) $@" >&2
exit 1
}
# Mistakes I commonly make:
# - Not bumping *all* versions
# Gesundheit
versions=$(git show :setup.py :hpilo.py :docs/conf.py | sed -ne "s/^ *_*\(version\|release\)_* *= *['\"]\([0-9.]*\)['\"].*/\2/p"; sed -ne 's/Version: \(.*\)/\1/p' devtools/python-hpilo.spec)
if [ $(echo $versions | wc -w) != 5 ]; then
die "Yikes. Can't find the versions! (Found: $versions)"
fi
if [ $(echo $versions | xargs -n1 echo | uniq | wc -w) != 1 ]; then
die "Inconsistent version numbers in setup.py / hpilo.py / docs/conf.py / python-hpilo.spec"
fi
|