My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mfpr 839B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. #
  3. # mfpr
  4. #
  5. # Make a PR of the current branch against RCBugFix or dev
  6. #
  7. MFINFO=$(mfinfo "$@") || exit
  8. IFS=' ' read -a INFO <<< "$MFINFO"
  9. ORG=${INFO[0]}
  10. FORK=${INFO[1]}
  11. REPO=${INFO[2]}
  12. TARG=${INFO[3]}
  13. BRANCH=${INFO[4]}
  14. if [[ $BRANCH == "(no" ]]; then
  15. echo "Git is busy with merge, rebase, etc."
  16. exit 1
  17. fi
  18. if [[ ! -z "$1" ]]; then { BRANCH=$1 ; git checkout $1 || exit 1; } fi
  19. if [[ $BRANCH == $TARG ]]; then
  20. echo "Can't make a PR from $BRANCH" ; exit
  21. fi
  22. if [ -z "$(git branch -vv | grep ^\* | grep \\[origin)" ]; then firstpush; fi
  23. TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }')
  24. URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1"
  25. if [ -z "$TOOL" ]; then
  26. echo "Can't find a tool to open the URL:"
  27. echo $URL
  28. else
  29. echo "Opening a New PR Form..."
  30. "$TOOL" "$URL"
  31. fi