-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstal_tooll.sh
executable file
·75 lines (61 loc) · 1.13 KB
/
instal_tooll.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
#!/bin/sh
set -e
#. /etc/os-release
rust_packages=(ripgrep starship)
install_haskell() {
curl -sSL https://get.haskellstack.org/ | sh
}
install_nix () {
curl -L https://nixos.org/nix/install | sh
}
install_rust() {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}
usage () {
cat <<EOF
usage: $0 [package|options]
OPTIONS:
-v: verbose
-h: help
PACKAGES:
rust: install rust
haskell: install haskell stack
nix: install nix
--system [system]: install home-manager system
EOF
}
install_nix_packages () {
cargo install $(rust_packages)
}
#cargo install starship --force
if [ -z "$1"]; then
usage
fi
while [ -n "$1" ]; do
case $1 in
-v)
verbose=""
;;
-h)
usage
exit 0
;;
haskell)
[[ -z "${verbose+x}" ]] || printf 'Installing Haskell Stack\n'
install_haskell;;
nix)
printf 'Installing Nix\n'
install_nix
case $2 in
--system)
esac
;;
rust)
printf 'Installing Rust\n'
install_rust;;
*)
usage
;;
esac
shift
done