install_macos.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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" ] || [ ${installrust} == "y" ]; 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. abvc
  28. # Install sqllite
  29. printMessage "Installing sqlLite3."
  30. brew install sqlite3
  31. # Enable the flutter stable channel
  32. printMessage "Setting up Flutter"
  33. flutter channel stable
  34. # Enable linux desktop
  35. flutter config --enable-macos-desktop
  36. # Fix any problems reported by flutter doctor
  37. flutter doctor
  38. # Add the githooks directory to your git configuration
  39. printMessage "Setting up githooks."
  40. git config core.hooksPath .githooks
  41. # Install go-gitlint
  42. printMessage "Installing go-gitlint."
  43. GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"
  44. curl -L https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} --output ${GOLINT_FILENAME}
  45. tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlint
  46. rm ${GOLINT_FILENAME}
  47. # Change to the frontend directory
  48. cd frontend
  49. # Install cargo make
  50. printMessage "Installing cargo-make."
  51. cargo install --force cargo-make
  52. # Install duckscript
  53. printMessage "Installing duckscript."
  54. cargo install --force duckscript_cli
  55. # Check prerequisites
  56. printMessage "Checking prerequisites."
  57. cargo make flowy_dev