-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-dev-tools.sh
56 lines (43 loc) · 1.21 KB
/
install-dev-tools.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
#!/bin/bash
set -eo pipefail
function run () {
echo $1
eval $1
}
function install_any_project_tools () {
curl --silent --location \
https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh |
sh
run "ubi --project houseabsolute/precious --in ~/bin"
run "ubi --project houseabsolute/omegasort --in ~/bin"
}
function install_go_project_tools () {
run "ubi --project golangci/golangci-lint --in ~/bin"
}
function install_rust_project_tools () {
run "rustup component add clippy"
}
if [ "$1" == "-v" ]; then
set -x
fi
mkdir -p $HOME/bin
set +e
echo ":$PATH:" | grep --extended-regexp ":$HOME/bin:" >& /dev/null
if [ "$?" -eq "0" ]; then
path_has_home_bin=1
fi
set -e
if [ -z "$path_has_home_bin" ]; then
PATH=$HOME/bin:$PATH
fi
install_any_project_tools
install_go_project_tools
install_rust_project_tools
echo "Tools were installed into $HOME/bin."
if [ -z "$path_has_home_bin" ]; then
echo "You should add $HOME/bin to your PATH."
fi
# For Perl, you would generally expect to have a cpanfile in the project root
# that included the relevant develop prereqs, so developers could just run
# `cpanm --installdeps --with-develop .`
exit 0