2022-07-18 19:24:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-07-19 17:07:25 +00:00
|
|
|
YELLOW="\e[93m"
|
2022-07-19 00:08:13 +00:00
|
|
|
GREEN="\e[32m"
|
2022-07-18 19:24:25 +00:00
|
|
|
RED="\e[31m"
|
|
|
|
ENDCOLOR="\e[0m"
|
|
|
|
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage() {
|
|
|
|
printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
printSuccess() {
|
|
|
|
printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
printError() {
|
|
|
|
printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-07-19 00:08:13 +00:00
|
|
|
# Install Rust
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "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."
|
2022-07-18 19:24:25 +00:00
|
|
|
|
2022-07-19 17:07:25 +00:00
|
|
|
read -p "$(printSuccess "Do you want to install Rust? [y/N]") " installrust
|
2022-07-18 19:24:25 +00:00
|
|
|
|
|
|
|
if [ ${installrust^^} == "Y" ]; then
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Installing Rust."
|
|
|
|
brew install rustup-init
|
2022-07-18 19:24:25 +00:00
|
|
|
rustup-init -y --default-toolchain=stable
|
|
|
|
else
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Skipping Rust installation."
|
2022-07-18 19:24:25 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Install sqllite
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Installing sqlLite3."
|
|
|
|
brew install sqlite3
|
2022-07-18 19:24:25 +00:00
|
|
|
|
|
|
|
# Enable the flutter stable channel
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Setting up Flutter"
|
2022-07-18 19:24:25 +00:00
|
|
|
flutter channel stable
|
|
|
|
|
|
|
|
# Enable linux desktop
|
2022-07-19 01:44:11 +00:00
|
|
|
flutter config --enable-macos-desktop
|
2022-07-18 19:24:25 +00:00
|
|
|
|
|
|
|
# Fix any problems reported by flutter doctor
|
|
|
|
flutter doctor
|
|
|
|
|
|
|
|
# Add the githooks directory to your git configuration
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Setting up githooks."
|
2022-07-18 19:24:25 +00:00
|
|
|
git config core.hooksPath .githooks
|
|
|
|
|
|
|
|
# Change to the frontend directory
|
|
|
|
cd frontend
|
|
|
|
|
|
|
|
# Install cargo make
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Installing cargo-make."
|
2022-07-18 19:24:25 +00:00
|
|
|
cargo install --force cargo-make
|
|
|
|
|
|
|
|
# Install duckscript
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Installing duckscript."
|
2022-07-18 19:24:25 +00:00
|
|
|
cargo install --force duckscript_cli
|
|
|
|
|
|
|
|
# Install CommitLint
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessagae "Installing CommitLint."
|
2022-07-18 19:24:25 +00:00
|
|
|
npm install @commitlint/cli @commitlint/config-conventional --save-dev
|
|
|
|
|
|
|
|
# Check prerequisites
|
2022-07-19 17:07:25 +00:00
|
|
|
printMessage "Checking prerequisites."
|
2022-07-18 19:24:25 +00:00
|
|
|
cargo make flowy_dev
|