install_macos.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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:-N}" == [Yy] ]]; then
  20. printMessage "Installing Rust."
  21. brew install rustup-init
  22. rustup-init -y --default-toolchain=stable
  23. source "$HOME/.cargo/env"
  24. else
  25. printMessage "Skipping Rust installation."
  26. fi
  27. # Install sqllite
  28. printMessage "Installing sqlLite3."
  29. brew install sqlite3
  30. # Enable the flutter stable channel
  31. printMessage "Setting up Flutter"
  32. flutter channel stable
  33. # Enable linux desktop
  34. flutter config --enable-macos-desktop
  35. # Fix any problems reported by flutter doctor
  36. flutter doctor
  37. # Add the githooks directory to your git configuration
  38. printMessage "Setting up githooks."
  39. git config core.hooksPath .githooks
  40. # Install go-gitlint
  41. printMessage "Installing go-gitlint."
  42. GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"
  43. curl -L https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} --output ${GOLINT_FILENAME}
  44. tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlint
  45. rm ${GOLINT_FILENAME}
  46. # Change to the frontend directory
  47. cd frontend || exit 1
  48. # Install cargo make
  49. printMessage "Installing cargo-make."
  50. cargo install --force cargo-make
  51. # Install duckscript
  52. printMessage "Installing duckscript."
  53. cargo install --force duckscript_cli
  54. # Check prerequisites
  55. printMessage "Checking prerequisites."
  56. cargo make flowy_dev