-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_sys.bash
executable file
·65 lines (52 loc) · 1.29 KB
/
init_sys.bash
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
#!/usr/bin/env bash
### Initialize a system of Debian/Ubuntu or Darwin. ###
common=(
git
# Version Control System
shellcheck
# A static analysis tool for shell scripts.
# See: https://github.com/koalaman/shellcheck
jq
# Command-line JSON processor
# See: https://github.com/stedolan/jq
cloc
# Count Lines of Code
# See: https://github.com/AlDanial/cloc
autojump
tree
htop
p7zip
)
debs=(
build-essential
exuberant-ctags
silversearcher-ag
# A code-searching tool similar to ack, but faster.
# See: https://github.com/ggreer/the_silver_searcher
)
brews=(
ag
# Same as silversearcher-ag
# See: https://github.com/ggreer/the_silver_searcher
)
name=$(uname)
case ${name} in
'Linux')
if [ "$(id -u)" == "0" ]
then # root
INSTALL="apt-get install"
else # Not root
INSTALL="sudo apt-get install"
fi
packages=("${common[@]}" "${debs[@]}");;
'Darwin')
INSTALL="brew install"
packages=("${common[@]}" "${brews[@]}");;
*)
echo "Unsupported system: ${name}" 1>&2
exit 1;;
esac
echo "Initialize ${name}..."
echo "$INSTALL" "${packages[@]}"
$INSTALL "${packages[@]}"
sudo pip3 install powerline-status psutil netifaces