| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 | #!/bin/bashYELLOW="\e[93m"GREEN="\e[32m"RED="\e[31m"ENDCOLOR="\e[0m"printMessage() {   printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"}printSuccess() {   printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"}printError() {   printf "${RED}AppFlowy : $1${ENDCOLOR}\n"}# Install RustprintMessage "The Rust programming language is required to compile AppFlowy."printMessage "We can install it now if you don't already have it on your system."read -p "$(printSuccess "Do you want to install Rust? [y/N]") " installrustif [[ "${installrust:-N}" == [Yy] ]]; then   printMessage "Installing Rust."   brew install rustup-init   rustup-init -y --default-toolchain=stable   source "$HOME/.cargo/env"else   printMessage "Skipping Rust installation."fi# Install sqlliteprintMessage "Installing sqlLite3."brew install sqlite3printMessage "Setting up Flutter"# Get the current Flutter versionFLUTTER_VERSION=$(flutter --version | grep -oE 'Flutter [^ ]+' | grep -oE '[^ ]+$')# Check if the current version is 3.10.1if [ "$FLUTTER_VERSION" = "3.10.1" ]; then   echo "Flutter version is already 3.10.1"else   # Get the path to the Flutter SDK   FLUTTER_PATH=$(which flutter)   FLUTTER_PATH=${FLUTTER_PATH%/bin/flutter}   current_dir=$(pwd)   cd $FLUTTER_PATH   # Use git to checkout version 3.10.1 of Flutter   git checkout 3.10.1   # Get back to current working directory   cd "$current_dir"   echo "Switched to Flutter version 3.10.1"fi# Enable linux desktopflutter config --enable-macos-desktop# Fix any problems reported by flutter doctorflutter doctor# Add the githooks directory to your git configurationprintMessage "Setting up githooks."git config core.hooksPath .githooks# Install go-gitlintprintMessage "Installing go-gitlint."GOLINT_FILENAME="go-gitlint_1.1.0_osx_x86_64.tar.gz"curl -L https://github.com/llorllale/go-gitlint/releases/download/1.1.0/${GOLINT_FILENAME} --output ${GOLINT_FILENAME}tar -zxv --directory .githooks/. -f ${GOLINT_FILENAME} gitlintrm ${GOLINT_FILENAME}# Change to the frontend directorycd frontend || exit 1# Install cargo makeprintMessage "Installing cargo-make."cargo install --force cargo-make# Install duckscriptprintMessage "Installing duckscript."cargo install --force duckscript_cli# Check prerequisitesprintMessage "Checking prerequisites."cargo make appflowy-flutter-deps-tools
 |