|
@@ -5,14 +5,27 @@
|
5
|
5
|
# Add all changed files, commit as "patch", do `mfrb` and `git push -f`
|
6
|
6
|
#
|
7
|
7
|
|
8
|
|
-[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1; }
|
9
|
|
-
|
10
|
8
|
MFINFO=$(mfinfo "$@") || exit 1
|
11
|
9
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
12
|
10
|
REPO=${INFO[2]}
|
13
|
11
|
TARG=${INFO[3]}
|
14
|
12
|
CURR=${INFO[5]}
|
15
|
13
|
|
|
14
|
+IND=6
|
|
15
|
+while [ $IND -lt ${#INFO[@]} ]; do
|
|
16
|
+ ARG=${INFO[$IND]}
|
|
17
|
+ case "$ARG" in
|
|
18
|
+ -q|--quick ) QUICK="-q" ;;
|
|
19
|
+ -h|--help ) USAGE=1 ;;
|
|
20
|
+ * ) USAGE=1 ; echo "unknown option: $ARG" ;;
|
|
21
|
+ esac
|
|
22
|
+ let IND+=1
|
|
23
|
+done
|
|
24
|
+
|
|
25
|
+[[ ${INFO[4]} =~ [0-9] ]] && USAGE=1
|
|
26
|
+
|
|
27
|
+[[ $USAGE ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; }
|
|
28
|
+
|
16
|
29
|
git add .
|
17
|
30
|
git commit -m "patch"
|
18
|
31
|
|
|
@@ -23,5 +36,5 @@ if [[ $CURR == $TARG ]]; then
|
23
|
36
|
echo "Don't alter the PR Target branch."; exit 1
|
24
|
37
|
fi
|
25
|
38
|
else
|
26
|
|
- mfrb "$@" && git push -f
|
|
39
|
+ mfrb $QUICK "$@" && git push -f
|
27
|
40
|
fi
|