-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathislandora-version-bump
executable file
·47 lines (41 loc) · 1.06 KB
/
islandora-version-bump
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Bash script to quickly version bump all Islandora Foundation modules for a release.
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] [-m MODULE LIST] [-c COMMIT MESSAGE] ...
Version bump all Islandora Foundation modules.
-h display this help and exit
-m MODULE LIST path to line delimited list of modules.
-c COMMIT MESSAGE commit message. example: "Version bump for 7.x-1.4"
EOF
}
ISLANDORA_COMMIT=""
ISLANDORA_MODULES_LIST=""
OPTIND=1
while getopts "h:m:c:" opt; do
case "$opt" in
h)
show_help
exit 0
;;
m) ISLANDORA_MODULES_LIST=$OPTARG
;;
c) ISLANDORA_COMMIT=$OPTARG
;;
'?')
show_help >&2
exit 1
;;
esac
done
if [[ -n $opt ]]; then
# version bump modules
cat "$ISLANDORA_MODULES_LIST" | while read line; do
cd "$line"
grep -rl "version = 7.x-1.6-RC1" | xargs sed -i 's#version = 7.x-1.6-RC1#version = 7.x-1.6#g'
git commit -m "$ISLANDORA_COMMIT" .
git push origin 7.x-1.6
cd ..
done
fi