2022-07-18 15:24:25 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
BLUE="\e[34m"
|
2022-07-18 20:08:13 -04:00
|
|
|
GREEN="\e[32m"
|
2022-07-18 15:24:25 -04:00
|
|
|
RED="\e[31m"
|
|
|
|
ENDCOLOR="\e[0m"
|
|
|
|
|
2022-07-18 20:08:13 -04:00
|
|
|
# Install Rust
|
2022-07-18 15:24:25 -04:00
|
|
|
echo -e "${BLUE}AppFlowy : The Rust programming language is required to compile AppFlowy.${ENDCOLOR}"
|
|
|
|
echo -e "${BLUE}AppFlowy : We can install it now if you don't already have it on your system.${ENDCOLOR}"
|
|
|
|
|
2022-07-18 20:08:13 -04:00
|
|
|
read -p "$(echo -e $GREEN"AppFlowy : Do you want to install Rust? [y/N]"$ENDCOLOR) " installrust
|
2022-07-18 15:24:25 -04:00
|
|
|
|
|
|
|
if [ ${installrust^^} == "Y" ]; then
|
|
|
|
echo -e "${BLUE}AppFlowy : Installing Rust.${ENDCOLOR}"
|
|
|
|
brew 'rustup-init'
|
|
|
|
rustup-init -y --default-toolchain=stable
|
|
|
|
else
|
|
|
|
echo -e "${BLUE}AppFlowy : Skipping Rust installation.${ENDCOLOR}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Install sqllite
|
|
|
|
echo -e "${BLUE}AppFlowy : Installing SqlLite3.${ENDCOLOR}"
|
|
|
|
brew 'sqlite3'
|
|
|
|
|
|
|
|
# Enable the flutter stable channel
|
|
|
|
echo -e "${BLUE}AppFlowy : Checking Flutter installation.${ENDCOLOR}"
|
|
|
|
flutter channel stable
|
|
|
|
|
|
|
|
# Enable linux desktop
|
2022-07-18 21:44:11 -04:00
|
|
|
flutter config --enable-macos-desktop
|
2022-07-18 15:24:25 -04:00
|
|
|
|
|
|
|
# Fix any problems reported by flutter doctor
|
|
|
|
flutter doctor
|
|
|
|
|
|
|
|
# Add the githooks directory to your git configuration
|
|
|
|
echo -e "${BLUE}AppFlowy : Setting up githooks.${ENDCOLOR}"
|
|
|
|
git config core.hooksPath .githooks
|
|
|
|
|
|
|
|
# Change to the frontend directory
|
|
|
|
cd frontend
|
|
|
|
|
|
|
|
# Install cargo make
|
|
|
|
echo -e "${BLUE}AppFlowy : Installing cargo-make.${ENDCOLOR}"
|
|
|
|
cargo install --force cargo-make
|
|
|
|
|
|
|
|
# Install duckscript
|
|
|
|
echo -e "${BLUE}AppFlowy : Installing duckscript.${ENDCOLOR}"
|
|
|
|
cargo install --force duckscript_cli
|
|
|
|
|
|
|
|
# Install CommitLint
|
|
|
|
echo -e "${BLUE}AppFlowy : Installing CommitLint.${ENDCOLOR}"
|
|
|
|
npm install @commitlint/cli @commitlint/config-conventional --save-dev
|
|
|
|
|
|
|
|
# Check prerequisites
|
|
|
|
echo -e "${BLUE}AppFlowy : Checking prerequisites.${ENDCOLOR}"
|
|
|
|
cargo make flowy_dev
|