-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcli.sh
More file actions
64 lines (55 loc) · 1.28 KB
/
cli.sh
File metadata and controls
64 lines (55 loc) · 1.28 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
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
install_python_tools() {
local packages=(
black # https://github.com/psf/black
)
for p in "${packages[@]}"; do
if pip3 show "$p" >/dev/null; then
warn "Package $p is already installed"
else
info "Installing package < $p >"
pip3 install "$p"
fi
done
}
install_go_tools() {
local packages=(
"github.com/go-delve/delve/cmd/dlv@latest"
"mvdan.cc/sh/v3/cmd/shfmt@latest"
"mvdan.cc/gofumpt@latest"
"golang.org/x/tools/gopls@latest"
"golang.org/x/tools/cmd/goimports@latest"
)
for p in "${packages[@]}"; do
if ! command -v "$p" &>/dev/null; then
info "Installing go tool < $p >"
go install "$p"
else
info "$p is already installed"
fi
done
}
install_rust_tools() {
source "$HOME/.cargo/env"
if ! command -v rust-analyzer &>/dev/null; then
info "Installing rust-analyzer"
brew install rust-analyzer
fi
local cargo_packages=(
"cargo-audit --features=fix"
cargo-edit
cargo-update
)
for p in "${cargo_packages[@]}"; do
info "Installing <cargo $p>"
expand=($p)
cargo install "${expand[@]}"
done
local rustup_components=(
rustfmt
clippy
)
for p in "${rustup_components[@]}"; do
info "Installing <rustup $p>"
rustup component add "$p"
done
}