2#===============================================================================
4# FILE: bump-versions.sh
6# USAGE: ./bump-versions.sh
8# DESCRIPTION: Bump the versions for all servant packages
11# REQUIREMENTS: bumper, bash >= 4
12# CREATED: 11.05.2015 21:36
14#===============================================================================
19DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
22SOURCES_TXT="$( dirname $DIR)/sources.txt"
25readarray -t SOURCES < "$SOURCES_TXT"
28 echo " bump-versions <POSITION> [-d|--dry-run]"
30 echo " Bumps the specified positional version of all servant packages."
31 echo " POSITION is a number between 0 and 3, inclusive."
35join () { local IFS="$1"; shift; echo "$*"; }
38 local NUM=$(find . -name 'servant*.cabal' | xargs grep "^version:" | awk '{ print $2 }' | uniq -c | wc -l)
39 if [ 1 -eq $NUM ] ; then
42 echo "versions of packages are not all the same!" && exit 1
47 echo "expecting one or more arguments. Got 0"
49elif [ $# -gt 2 ] ; then
50 echo "expecting one or more arguments"
56while [ "${1:-unset}" != "unset" ] ; do
59 -d | --dry-run) DRY_RUN=true
61 0) if POSITION="none" ; then POSITION=0 ; else usage ; fi
63 1) if POSITION="none" ; then POSITION=1 ; else usage ; fi
65 2) if POSITION="none" ; then POSITION=2 ; else usage ; fi
67 3) if POSITION="none" ; then POSITION=3 ; else usage ; fi
74 bumper --dry-run -"$POSITION" $(join , "${SOURCES[@]}")
76 bumper -"$POSITION" $(join , "${SOURCES[@]}")
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list