install_linux.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. BLUE="\e[34m"
  3. GREEN="\e[32m"
  4. RED="\e[31m"
  5. ENDCOLOR="\e[0m"
  6. # Note: This script does not install applications which are installed by the package manager. There are too many package managers out there.
  7. # Install Rust
  8. echo -e "${BLUE}AppFlowy : The Rust programming language is required to compile AppFlowy.${ENDCOLOR}"
  9. echo -e "${BLUE}AppFlowy : We can install it now if you don't already have it on your system.${ENDCOLOR}"
  10. read -p "$(echo -e $GREEN"AppFlowy : Do you want to install Rust? [y/N]"$ENDCOLOR) " installrust
  11. if [ ${installrust^^} == "Y" ]; then
  12. echo -e "${BLUE}AppFlowy : Installing Rust.${ENDCOLOR}"
  13. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  14. source $HOME/.cargo/env
  15. rustup toolchain install stable
  16. rustup default stable
  17. else
  18. echo -e "${BLUE}AppFlowy : Skipping Rust installation.${ENDCOLOR}"
  19. fi
  20. # Enable the flutter stable channel
  21. echo -e "${BLUE}AppFlowy : Checking Flutter installation.${ENDCOLOR}"
  22. flutter channel stable
  23. # Enable linux desktop
  24. flutter config --enable-linux-desktop
  25. # Fix any problems reported by flutter doctor
  26. flutter doctor
  27. # Add the githooks directory to your git configuration
  28. echo -e "${BLUE}AppFlowy : Setting up githooks.${ENDCOLOR}"
  29. git config core.hooksPath .githooks
  30. # Change to the frontend directory
  31. cd frontend
  32. # Install cargo make
  33. echo -e "${BLUE}AppFlowy : Installing cargo-make.${ENDCOLOR}"
  34. cargo install --force cargo-make
  35. # Install duckscript
  36. echo -e "${BLUE}AppFlowy : Installing duckscript.${ENDCOLOR}"
  37. cargo install --force duckscript_cli
  38. # Install CommitLint
  39. echo -e "${BLUE}AppFlowy : Installing CommitLint.${ENDCOLOR}"
  40. npm install @commitlint/cli @commitlint/config-conventional --save-dev
  41. # Check prerequisites
  42. echo -e "${BLUE}AppFlowy : Checking prerequisites.${ENDCOLOR}"
  43. cargo make flowy_dev