-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_apps.sh
executable file
·141 lines (115 loc) · 2.41 KB
/
install_apps.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env bash
source lib/core.sh
function install_app() {
# Detect the platform (similar to $OSTYPE)
#echo $OS
#echo $DIST
echo "Install $1"
if [ "$OS" == "mac" ]; then
cmd="brew install"
fi
if [ "$OS" == "linux" ]; then
if [ "$DIST" == "ubuntu" ]; then
cmd="sudo apt-get install -y"
elif [ "$DIST" == "suse" ]; then
cmd="sudo zypper in -y"
fi
fi
echo "Running '$cmd $1'"
cmd=`$cmd $1`
}
function is_installed() {
local is_installed=`command -v $1 | wc -l`
echo "$is_installed"
}
function test_or_install_app() {
is_it=$(is_installed $1)
if [ $is_it -eq 0 ]; then
install_app $1
else
echo "$1 already installed"
fi
}
function install_jo_src() {
is_it=$(is_installed jo)
if [ $is_it -eq 1 ]; then
echo "jo already installed"
return
else
echo "Building Jo from src"
fi
# install jo
# need autoconf, automake, libtool
test_or_install_app autoconf
test_or_install_app automake
test_or_install_app libtool
if [ -d jo ]; then
rm -rf jo
fi
echo "Find info about jo here: https://github.com/jpmens/jo"
git clone https://github.com/jpmens/jo && cd jo
autoreconf -i
./configure
make check
sudo make install
cd ..
}
function install_jo() {
# on the Mac, we can use brew
case $OS in
'mac') install_app jo ;;
'linux') install_jo_src ;;
*) ;;
esac
}
function install_xclip() {
# mac already has pbcopy
case $OS in
'linux') test_or_install_app xclip ;;
*) ;;
esac
}
function install_coreutils() {
# on the Mac, we can use brew
case $OS in
'mac') install_app coreutils ;;
*) ;;
esac
}
# needed for the vim-data
function install_vimdata() {
test_or_install_app vim-data
}
# needed for the vim-autopep8 plugin
function install_autopep8() {
test_or_install_app autopep8
}
# install the fish shell
function install_fish() {
test_or_install_app fish
}
# install the virtualfish python lib
function install_virtualfish() {
sudo pip install virtualfish
}
# make sure we have a src dir
if [ ! -d src ]; then
mkdir src
fi
# install zsh
test_or_install_app zsh
test_or_install_app lnav
# install coreutils on mac only
install_coreutils
test_or_install_app lnav
# install xclip on linux only
install_xclip
# install jo
# install_jo
# install autopep8
install_vimdata
install_autopep8
# install fish
install_fish
# install virtualfish
install_virtualfish