My Marlin configs for Fabrikator Mini and CTC i3 Pro B
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/usr/bin/env bash
  2. #
  3. # mfpub
  4. #
  5. # Use Jekyll to generate Marlin Documentation, which is then
  6. # git-pushed to Github to publish it to the live site.
  7. # This publishes the current branch, and doesn't force
  8. # changes to be pushed to the 'master' branch. Be sure to push
  9. # any permanent changes to 'master'.
  10. #
  11. MFINFO=$(mfinfo "$@") || exit
  12. IFS=' ' read -a INFO <<< "$MFINFO"
  13. ORG=${INFO[0]}
  14. FORK=${INFO[1]}
  15. REPO=${INFO[2]}
  16. TARG=${INFO[3]}
  17. BRANCH=${INFO[4]}
  18. if [[ $ORG != "MarlinFirmware" || $REPO != "MarlinDocumentation" ]]; then
  19. echo "Wrong repository."
  20. exit
  21. fi
  22. if [[ $BRANCH == "gh-pages" ]]; then
  23. echo "Can't build from 'gh-pages.' Only the Jekyll branches (based on 'master')."
  24. bundle exec jekyll serve --watch
  25. exit
  26. fi
  27. if [[ $BRANCH != "master" ]]; then
  28. echo "Don't forget to update and push 'master'!"
  29. # GOJF Card
  30. git stash
  31. fi
  32. # Check out the named branch (or stay in current)
  33. git checkout $BRANCH
  34. echo "Generating MarlinDocumentation..."
  35. COMMIT=$( git log --format="%H" -n 1 )
  36. # Clean out changes and other junk in the branch
  37. git reset --hard
  38. git clean -d -f
  39. # Push 'master' to the fork and make a proper PR...
  40. if [[ $BRANCH == "master" ]]; then
  41. if [[ $FORK == "MarlinFirmware" ]]; then
  42. # Allow working directly with the main fork
  43. git push -f upstream
  44. else
  45. if [ -z "$(git branch -vv | grep ^\* | grep \\[origin)" ]; then firstpush; fi
  46. git push -f origin
  47. TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }')
  48. URL="https://github.com/$ORG/$REPO/compare/$TARG...$FORK:$BRANCH?expand=1"
  49. if [ -z "$TOOL" ]; then
  50. echo "Can't find a tool to open the URL:"
  51. echo $URL
  52. else
  53. echo "Opening a New PR Form..."
  54. "$TOOL" "$URL"
  55. fi
  56. fi
  57. fi
  58. # Uncomment to compress the final html files
  59. # mv ./_plugins/jekyll-press.rb-disabled ./_plugins/jekyll-press.rb
  60. # bundle install
  61. # build the site statically and proof it
  62. bundle exec jekyll build --profile --trace --no-watch
  63. bundle exec htmlproofer ./_site --only-4xx --allow-hash-href --check-favicon --check-html --url-swap ".*marlinfw.org/:/"
  64. # Sync the built site into a temporary folder
  65. TMPFOLDER=$( mktemp -d )
  66. rsync -av _site/ ${TMPFOLDER}/
  67. # Clean out changes and other junk in the branch
  68. git reset --hard
  69. git clean -d -f
  70. # Sync built-site with gh-pages
  71. git checkout gh-pages
  72. rsync -av ${TMPFOLDER}/ ./
  73. # Commit and push the new live site directly
  74. git add --all
  75. git commit --message "Built from ${COMMIT}"
  76. git push upstream
  77. # remove the temporary folder
  78. rm -rf ${TMPFOLDER}
  79. # Go back to the branch we started from
  80. git checkout $BRANCH