mach 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #/bin/bash
  2. # == | Setup | ========================================================================================================
  3. set -x #echo on
  4. # ---------------------------------------------------------------------------------------------------------------------
  5. if [[ -z "$1" ]]; then
  6. printf "${0} usage: bootstrap | build | run\n"
  7. exit 1
  8. fi
  9. # =====================================================================================================================
  10. # == | Functions | ====================================================================================================
  11. shmach_cmd_bootstrap() {
  12. printf "${0} error: needs rewritten\n"
  13. exit 1
  14. mkdir -pv "./.obj/cache"
  15. cd "./.obj/cache"
  16. # --------------------------------- #
  17. M3_HGBUNDLE_BASEURL="https://files.thereisonlyxul.org/"
  18. M3_MOZILLA_RELEASE=""
  19. M3_COMM_RELEASE=""
  20. if [[ ! -f "./${M3_MOZILLA_RELEASE}" ]]; then
  21. wget $M3_HGBUNDLE_BASEURL/$M3_MOZILLA_RELEASE
  22. wget $M3_HGBUNDLE_BASEURL/$M3_COMM_RELEASE
  23. fi
  24. # --------------------------------- #
  25. if [[ ! -d "./source" ]]; then
  26. hg clone ./cache/$M3_MOZILLA_RELEASE source
  27. hg clone ./cache/$M3_COMM_RELEASE source/comm
  28. fi
  29. # --------------------------------- #
  30. printf "${0} information: Bootstrap complete.\n"
  31. }
  32. # ---------------------------------------------------------------------------------------------------------------------
  33. shmach_cmd_build() {
  34. printf "${0} information: Build complete.\n"
  35. }
  36. # ---------------------------------------------------------------------------------------------------------------------
  37. shmach_cmd_run() {
  38. printf "${0} information: Run complete.\n"
  39. }
  40. # =====================================================================================================================
  41. # == | Main | =========================================================================================================
  42. "shmach_cmd_${@:1}"
  43. exit 0
  44. # =====================================================================================================================