forked from AppFlowy-IO/AppFlowy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_macos.sh
executable file
·93 lines (71 loc) · 2.35 KB
/
install_macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env bash
YELLOW="\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 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:-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 sqllite
printMessage "Installing sqlLite3."
brew install sqlite3
printMessage "Setting up Flutter"
# Get the current Flutter version
FLUTTER_VERSION=$(flutter --version | grep -oE 'Flutter [^ ]+' | grep -oE '[^ ]+$')
# Check if the current version is 3.27.4
if [ "$FLUTTER_VERSION" = "3.27.4" ]; then
echo "Flutter version is already 3.27.4"
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.27.4 of Flutter
git checkout 3.27.4
# Get back to current working directory
cd "$current_dir"
echo "Switched to Flutter version 3.27.4"
fi
# Enable linux desktop
flutter config --enable-macos-desktop
# Fix any problems reported by flutter doctor
flutter doctor
# Add the githooks directory to your git configuration
printMessage "Setting up githooks."
git config core.hooksPath .githooks
# Install go-gitlint
printMessage "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} gitlint
rm ${GOLINT_FILENAME}
# Change to the frontend directory
cd frontend || exit 1
# Install cargo make
printMessage "Installing cargo-make."
cargo install --force cargo-make
# Install duckscript
printMessage "Installing duckscript."
cargo install --force --locked duckscript_cli
# Check prerequisites
printMessage "Checking prerequisites."
cargo make appflowy-flutter-deps-tools