install_linux.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. # Note: This script does not install applications which are installed by the package manager. There are too many package managers out there.
  16. # Install Rust
  17. printMessage "The Rust programming language is required to compile AppFlowy."
  18. printMessage "We can install it now if you don't already have it on your system."
  19. read -p "$(printSuccess "Do you want to install Rust? [y/N]") " installrust
  20. if [ ${installrust^^} == "Y" ]; then
  21. printMessage "Installing Rust."
  22. curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  23. source $HOME/.cargo/env
  24. rustup toolchain install stable
  25. rustup default stable
  26. else
  27. printMessage "Skipping Rust installation."
  28. fi
  29. # Enable the flutter stable channel
  30. printMessage "Setting up Flutter"
  31. flutter channel stable
  32. # Enable linux desktop
  33. flutter config --enable-linux-desktop
  34. # Fix any problems reported by flutter doctor
  35. flutter doctor
  36. printMessage "Installing keybinder-3.0"
  37. if command apt-get &> /dev/null; then
  38. sudo apt-get install keybinder-3.0-dev
  39. elif command dnf &> /dev/null; then
  40. sudo dnf install keybinder3-devel
  41. else
  42. echo 'Your system is not supported, please install keybinder3 manually.'
  43. fi
  44. # Add the githooks directory to your git configuration
  45. printMessage "Setting up githooks."
  46. git config core.hooksPath .githooks
  47. # Install go-gitlint
  48. printMessage "Installing go-gitlint."
  49. GOLINT_FILENAME="go-gitlint_1.1.0_linux_x86_64.tar.gz"
  50. wget https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME}
  51. tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlint
  52. rm ${GOLINT_FILENAME}
  53. # Change to the frontend directory
  54. cd frontend
  55. # Install cargo make
  56. printMessage "Installing cargo-make."
  57. cargo install --force cargo-make
  58. # Install duckscript
  59. printMessage "Installing duckscript."
  60. cargo install --force duckscript_cli
  61. # Check prerequisites
  62. printMessage "Checking prerequisites."
  63. cargo make appflowy-deps-tools