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.

mfinfo 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. #
  3. # mfinfo
  4. #
  5. # Get the following helpful git info about the working directory:
  6. #
  7. # - Remote (upstream) Org name (MarlinFirmware)
  8. # - Remote (origin) Org name (your Github username)
  9. # - Repo Name (Marlin or MarlinDev)
  10. # - Marlin Target branch (RCBugFix or dev)
  11. # - Branch Name (the current branch or the one that was passed)
  12. #
  13. REPO=$(git remote get-url upstream 2>/dev/null | sed -E 's/.*\/(.*)\.git/\1/')
  14. if [[ -z $REPO ]]; then
  15. echo "`basename $0`: No 'upstream' remote found." 1>&2 ; exit 1
  16. fi
  17. ORG=$(git remote get-url upstream 2>/dev/null | sed -E 's/.*[\/:](.*)\/.*$/\1/')
  18. if [[ $ORG != MarlinFirmware ]]; then
  19. echo "`basename $0`: Not a Marlin repository."
  20. exit 1
  21. fi
  22. case "$REPO" in
  23. Marlin ) TARG=RCBugFix ;;
  24. MarlinDev ) TARG=dev ;;
  25. esac
  26. FORK=$(git remote get-url origin 2>/dev/null | sed -E 's/.*[\/:](.*)\/.*$/\1/')
  27. case "$#" in
  28. 0 ) BRANCH=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g') ;;
  29. 1 ) BRANCH=$1 ;;
  30. * ) echo "Usage: `basename $0` [branch]" 1>&2 ; exit 1 ;;
  31. esac
  32. echo "$ORG $FORK $REPO $TARG $BRANCH"