Merge pull request #147 from haskell-servant/pingu/fix-bump-versions-script

Make bump-versions.sh work
This commit is contained in:
Alp Mestanogullari 2015-07-07 08:29:23 +02:00
commit 9c50804c6f
2 changed files with 9 additions and 4 deletions

View file

@ -16,7 +16,8 @@
set -o nounset set -o nounset
set -o errexit set -o errexit
. lib/common.sh DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
. "${DIR}/scripts/lib/common.sh"
usage () { usage () {
echo " bump-versions.sh <POSITION> [-d|--dry-run]" echo " bump-versions.sh <POSITION> [-d|--dry-run]"
@ -54,8 +55,11 @@ while [ "${1:-unset}" != "unset" ] ; do
done done
if $DRY_RUN ; then if $DRY_RUN ; then
bumper --dry-run -"$POSITION" $(join , "${SOURCES[@]}") echo "Would have bumped position ${POSITION} on these packages:"
( cd "$ROOT" && bumper --dry-run -"$POSITION" $(join , "${SOURCES[@]}") )
else else
bumper -"$POSITION" $(join , "${SOURCES[@]}") ( cd "$ROOT" && bumper -"$POSITION" $(join , "${SOURCES[@]}") )
fi fi
# Trailing newline, bumper does not ship with its own.
echo

View file

@ -11,6 +11,7 @@
DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )) DIR=$( dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
ROOT=$( dirname $DIR )
DRY_RUN=false DRY_RUN=false
POSITION="none" POSITION="none"
SOURCES_TXT="$( dirname $DIR)/sources.txt" SOURCES_TXT="$( dirname $DIR)/sources.txt"
@ -23,7 +24,7 @@ readarray -t SOURCES < "$SOURCES_TXT"
join () { local IFS="$1"; shift; echo "$*"; } join () { local IFS="$1"; shift; echo "$*"; }
versions_equal () { versions_equal () {
local NUM=$(find . -name 'servant*.cabal' | xargs grep "^version:" | awk '{ print $2 }' | uniq -c | wc -l) local NUM=$(cd "$ROOT" && find . -name 'servant*.cabal' | xargs grep "^version:" | awk '{ print $2 }' | uniq -c | wc -l)
if [ 1 -eq $NUM ] ; then if [ 1 -eq $NUM ] ; then
return 0 return 0
else else