You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
636 B
Plaintext
31 lines
636 B
Plaintext
8 years ago
|
#!/usr/bin/env bash
|
||
|
#
|
||
5 years ago
|
# mfqp [1|2|3]
|
||
8 years ago
|
#
|
||
5 years ago
|
# - git add .
|
||
|
# - git commit --amend
|
||
|
# - ghpc
|
||
8 years ago
|
#
|
||
|
|
||
7 years ago
|
MFINFO=$(mfinfo "$@") || exit 1
|
||
8 years ago
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||
|
REPO=${INFO[2]}
|
||
|
TARG=${INFO[3]}
|
||
7 years ago
|
CURR=${INFO[5]}
|
||
8 years ago
|
|
||
6 years ago
|
IND=6
|
||
|
while [ $IND -lt ${#INFO[@]} ]; do
|
||
|
ARG=${INFO[$IND]}
|
||
|
case "$ARG" in
|
||
|
-h|--help ) USAGE=1 ;;
|
||
|
* ) USAGE=1 ; echo "unknown option: $ARG" ;;
|
||
|
esac
|
||
|
let IND+=1
|
||
|
done
|
||
|
|
||
5 years ago
|
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3]" 1>&2 ; exit 1 ; }
|
||
6 years ago
|
|
||
5 years ago
|
[[ $CURR == $TARG && $REPO != "MarlinDocumentation" ]] && { echo "Don't alter the PR Target branch."; exit 1 ; }
|
||
6 years ago
|
|
||
5 years ago
|
git add . && git commit --amend && git push -f
|