build.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env bash
  2. set -ex
  3. cargo update
  4. cargo build
  5. ./target/debug/oddjobs_renderer "$1" > ./odd-jobs.html
  6. ./target/debug/oddjobs_renderer "$2" > ./guides/index.html
  7. declare -a guide_slugs=("woodsman" "str-cleric" "magelet" "swashbuckler" "introduction-to-odd-jobs")
  8. for s in "${guide_slugs[@]}"
  9. do
  10. for md in "$2"/"${s}"/*.md
  11. do
  12. md_filename=$(basename -- "${md}")
  13. lang=$(cut -d. -f2 <(echo -n "${md_filename}"))
  14. if [[ "${lang}" = 'md' ]]
  15. then
  16. ./target/debug/oddjobs_renderer "${md}" > ./guides/"${s}"/index.html
  17. else
  18. ./target/debug/oddjobs_renderer "${md}" > ./guides/"${s}"/index."${lang}".html
  19. fi
  20. done
  21. find "$2"/"${s}"/ -type f \! \( -name '*.md' -o -name '*.bak' \) -exec cp "{}" ./guides/"${s}"/ \;
  22. done
  23. ./target/debug/oddjobs_renderer "$3" > ./archive/index.html
  24. ./target/debug/oddjobs_renderer "$4" --rankings > ./rankings/index.html
  25. cd ./dmg-calc/
  26. tsc
  27. cd ..
  28. rm -rf ./gish-ap-calc/
  29. cp -dR "$5"/gish-ap-calc/ ./gish-ap-calc/
  30. cd ./gish-ap-calc/
  31. tsc
  32. cd ..