install_macos.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/bash
  2. YELLOW="\e[93m"
  3. GREEN="\e[32m"
  4. RED="\e[31m"
  5. ENDCOLOR="\e[0m"
  6. printMessage() {
  7. printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
  8. }
  9. printSuccess() {
  10. printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
  11. }
  12. printError() {
  13. printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
  14. }
  15. # Install Rust
  16. printMessage "The Rust programming language is required to compile AppFlowy."
  17. printMessage "We can install it now if you don't already have it on your system."
  18. read -p "$(printSuccess "Do you want to install Rust? [y/N]") " installrust
  19. if [ ${installrust^^} == "Y" ]; then
  20. printMessage "Installing Rust."
  21. brew install rustup-init
  22. rustup-init -y --default-toolchain=stable
  23. else
  24. printMessage "Skipping Rust installation."
  25. fi
  26. # Install sqllite
  27. printMessage "Installing sqlLite3."
  28. brew install sqlite3
  29. # Enable the flutter stable channel
  30. printMessage "Setting up Flutter"
  31. flutter channel stable
  32. # Enable linux desktop
  33. flutter config --enable-macos-desktop
  34. # Fix any problems reported by flutter doctor
  35. flutter doctor
  36. # Add the githooks directory to your git configuration
  37. printMessage "Setting up githooks."
  38. git config core.hooksPath .githooks
  39. # Install go-gitlint
  40. printMessage "Installing go-gitlint."
  41. GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"
  42. wget https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME}
  43. tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlint
  44. rm ${GOLINT_FILENAME}
  45. # Change to the frontend directory
  46. cd frontend
  47. # Install cargo make
  48. printMessage "Installing cargo-make."
  49. cargo install --force cargo-make
  50. # Install duckscript
  51. printMessage "Installing duckscript."
  52. cargo install --force duckscript_cli
  53. # Check prerequisites
  54. printMessage "Checking prerequisites."
  55. cargo make flowy_dev