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.

use_example_configs 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. #
  3. # use_example_configs [repo:]configpath
  4. #
  5. # Examples:
  6. # use_example_configs Creality/CR-10/CrealityV1
  7. # use_example_configs release-2.0.9.4:Creality/CR-10/CrealityV1
  8. #
  9. # If a configpath has spaces (or quotes) escape them or enquote the path
  10. #
  11. which curl >/dev/null && TOOL='curl -L -s -S -f -o wgot'
  12. which wget >/dev/null && TOOL='wget -q -O wgot'
  13. CURR=$(git branch 2>/dev/null | grep ^* | sed 's/\* //g')
  14. [[ $CURR == "bugfix-2.0.x" ]] && BRANCH=bugfix-2.0.x || BRANCH=bugfix-2.1.x
  15. REPO=$BRANCH
  16. if [[ $# > 0 ]]; then
  17. IFS=: read -r PART1 PART2 <<< "$@"
  18. [[ -n $PART2 ]] && { UDIR="$PART2" ; REPO="$PART1" ; } \
  19. || { UDIR="$PART1" ; }
  20. RDIR="${UDIR// /%20}"
  21. echo "Fetching $UDIR configurations from $REPO..."
  22. EXAMPLES="examples/$RDIR"
  23. else
  24. EXAMPLES="default"
  25. fi
  26. CONFIGS="https://raw.githubusercontent.com/MarlinFirmware/Configurations/$REPO/config/${EXAMPLES}"
  27. restore_configs
  28. cd Marlin
  29. $TOOL "$CONFIGS/Configuration.h" >/dev/null 2>&1 && mv wgot Configuration.h
  30. $TOOL "$CONFIGS/Configuration_adv.h" >/dev/null 2>&1 && mv wgot Configuration_adv.h
  31. $TOOL "$CONFIGS/_Bootscreen.h" >/dev/null 2>&1 && mv wgot _Bootscreen.h
  32. $TOOL "$CONFIGS/_Statusscreen.h" >/dev/null 2>&1 && mv wgot _Statusscreen.h
  33. rm -f wgot
  34. cd - >/dev/null