Merge pull request #648 from MikeWallaceDev/fix_colors

fix: colors and brew install for mac
This commit is contained in:
Mike Wallace 2022-07-19 14:08:57 -04:00 committed by GitHub
commit 471ae9ddf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 28 deletions

View File

@ -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}" printMessage "The Rust programming language is required to compile AppFlowy."
echo -e "${BLUE}AppFlowy : We can install it now if you don't already have it on your system.${ENDCOLOR}" 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

View File

@ -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"
# Install Rust printMessage() {
echo -e "${BLUE}AppFlowy : The Rust programming language is required to compile AppFlowy.${ENDCOLOR}" printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
echo -e "${BLUE}AppFlowy : We can install it now if you don't already have it on your system.${ENDCOLOR}" }
read -p "$(echo -e $GREEN"AppFlowy : Do you want to install Rust? [y/N]"$ENDCOLOR) " installrust printSuccess() {
printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
}
printError() {
printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
}
# Install Rust
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 "$(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."
brew 'rustup-init' brew install rustup-init
rustup-init -y --default-toolchain=stable rustup-init -y --default-toolchain=stable
else else
echo -e "${BLUE}AppFlowy : Skipping Rust installation.${ENDCOLOR}" printMessage "Skipping Rust installation."
fi fi
# Install sqllite # Install sqllite
echo -e "${BLUE}AppFlowy : Installing SqlLite3.${ENDCOLOR}" printMessage "Installing sqlLite3."
brew 'sqlite3' brew install sqlite3
# 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-macos-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}" printMessagae "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