-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathbootstrap
More file actions
37 lines (28 loc) · 1.16 KB
/
bootstrap
File metadata and controls
37 lines (28 loc) · 1.16 KB
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
#!/bin/sh
set -e
reset='\e[0m'
red='\e[31m'
green='\e[32m'
cyan='\e[36m'
install_dependency() {
id_dependency="$1"
id_description="$2"
id_installation_command="$3"
if ! command -v "$id_dependency" > /dev/null; then
printf "${green}Installing '$red%s$green' ('$cyan%s$green' binary)\n$reset" "$id_description" "$id_dependency"
sh -c "$id_installation_command"
printf "${green}Installed '$cyan%s$green' successfully.
Please make sure '$cyan%s$green' binary is in your \$PATH.\n$reset" "$id_dependency" "$id_dependency"
exit 1
fi
}
# shellcheck disable=SC2016
install_dependency brew Homebrew '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
install_dependency rustc Rust 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh'
cargo install cargo-bundle
cargo install cargo-diff-tools --git https://github.com/warpdotdev/cargo-diff-tools
# Update brew
brew update
rustup component add clippy
install_dependency python3-pip 'Python package manager' 'sudo apt install python3-pip'
install_dependency jsonschema-cli 'JSON schema validator' 'pip3 install jsonschema-cli'