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.

mfdoc 837B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. #
  3. # mfdoc
  4. #
  5. # Start Jekyll in watch mode to work on Marlin Documentation and preview locally
  6. #
  7. [[ $# == 0 ]] || { echo "Usage: `basename $0`" 1>&2 ; exit 1; }
  8. MFINFO=$(mfinfo "$@") || exit 1
  9. IFS=' ' read -a INFO <<< "$MFINFO"
  10. ORG=${INFO[0]}
  11. REPO=${INFO[2]}
  12. BRANCH=${INFO[5]}
  13. [[ $ORG == "MarlinFirmware" && $REPO == "MarlinDocumentation" ]] || { echo "Wrong repository." 1>&2; exit 1; }
  14. opensite() {
  15. TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }')
  16. URL="http://127.0.0.1:4000/"
  17. if [ -z "$TOOL" ]; then
  18. echo "Can't find a tool to open the URL:"
  19. echo $URL
  20. else
  21. echo "Opening preview site in the browser..."
  22. "$TOOL" "$URL"
  23. fi
  24. }
  25. echo "Previewing MarlinDocumentation..."
  26. # wait to open the url for about 8s
  27. ( sleep 45; opensite ) &
  28. bundle exec jekyll serve --watch --incremental