|
@@ -1,30 +1,43 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
|
|
|
-BLUE="\e[34m"
|
|
|
|
|
|
+YELLOW="\e[93m"
|
|
GREEN="\e[32m"
|
|
GREEN="\e[32m"
|
|
RED="\e[31m"
|
|
RED="\e[31m"
|
|
ENDCOLOR="\e[0m"
|
|
ENDCOLOR="\e[0m"
|
|
|
|
|
|
|
|
+printMessage() {
|
|
|
|
+ printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+printSuccess() {
|
|
|
|
+ printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+printError() {
|
|
|
|
+ printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
# Note: This script does not install applications which are installed by the package manager. There are too many package managers out there.
|
|
# Note: This script does not install applications which are installed by the package manager. There are too many package managers out there.
|
|
|
|
|
|
# Install Rust
|
|
# Install Rust
|
|
-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}"
|
|
|
|
|
|
+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."
|
|
|
|
|
|
-read -p "$(echo -e $GREEN"AppFlowy : Do you want to install Rust? [y/N]"$ENDCOLOR) " installrust
|
|
|
|
|
|
+read -p "$(printSuccess "Do you want to install Rust? [y/N]") " installrust
|
|
|
|
|
|
if [ ${installrust^^} == "Y" ]; then
|
|
if [ ${installrust^^} == "Y" ]; then
|
|
- echo -e "${BLUE}AppFlowy : Installing Rust.${ENDCOLOR}"
|
|
|
|
|
|
+ printMessage "Installing Rust."
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
source $HOME/.cargo/env
|
|
source $HOME/.cargo/env
|
|
rustup toolchain install stable
|
|
rustup toolchain install stable
|
|
rustup default stable
|
|
rustup default stable
|
|
else
|
|
else
|
|
- echo -e "${BLUE}AppFlowy : Skipping Rust installation.${ENDCOLOR}"
|
|
|
|
|
|
+ printMessage "Skipping Rust installation."
|
|
fi
|
|
fi
|
|
|
|
|
|
# Enable the flutter stable channel
|
|
# Enable the flutter stable channel
|
|
-echo -e "${BLUE}AppFlowy : Checking Flutter installation.${ENDCOLOR}"
|
|
|
|
|
|
+printMessage "Setting up Flutter"
|
|
flutter channel stable
|
|
flutter channel stable
|
|
|
|
|
|
# Enable linux desktop
|
|
# Enable linux desktop
|
|
@@ -34,24 +47,24 @@ flutter config --enable-linux-desktop
|
|
flutter doctor
|
|
flutter doctor
|
|
|
|
|
|
# Add the githooks directory to your git configuration
|
|
# Add the githooks directory to your git configuration
|
|
-echo -e "${BLUE}AppFlowy : Setting up githooks.${ENDCOLOR}"
|
|
|
|
|
|
+printMessage "Setting up githooks."
|
|
git config core.hooksPath .githooks
|
|
git config core.hooksPath .githooks
|
|
|
|
|
|
# Change to the frontend directory
|
|
# Change to the frontend directory
|
|
cd frontend
|
|
cd frontend
|
|
|
|
|
|
# Install cargo make
|
|
# Install cargo make
|
|
-echo -e "${BLUE}AppFlowy : Installing cargo-make.${ENDCOLOR}"
|
|
|
|
|
|
+printMessage "Installing cargo-make."
|
|
cargo install --force cargo-make
|
|
cargo install --force cargo-make
|
|
|
|
|
|
# Install duckscript
|
|
# Install duckscript
|
|
-echo -e "${BLUE}AppFlowy : Installing duckscript.${ENDCOLOR}"
|
|
|
|
|
|
+printMessage "Installing duckscript."
|
|
cargo install --force duckscript_cli
|
|
cargo install --force duckscript_cli
|
|
|
|
|
|
# Install CommitLint
|
|
# Install CommitLint
|
|
-echo -e "${BLUE}AppFlowy : Installing CommitLint.${ENDCOLOR}"
|
|
|
|
|
|
+printMessage "Installing CommitLint."
|
|
npm install @commitlint/cli @commitlint/config-conventional --save-dev
|
|
npm install @commitlint/cli @commitlint/config-conventional --save-dev
|
|
|
|
|
|
# Check prerequisites
|
|
# Check prerequisites
|
|
-echo -e "${BLUE}AppFlowy : Checking prerequisites.${ENDCOLOR}"
|
|
|
|
|
|
+printMessage "Checking prerequisites."
|
|
cargo make flowy_dev
|
|
cargo make flowy_dev
|