forked from jessonfoo/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·53 lines (46 loc) · 1.33 KB
/
install.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
#!/bin/bash
if [ ! -d "$HOME/.gzn" ]; then
platform='unknown'
unamestr=$(uname)
if [[ $unamestr == 'Linux' ]]; then
platform='linux'
pkgmgr='unknown'
ag='apt-get'
declare -A osInfo;
osInfo[/etc/redhat-release]=yum
osInfo[/etc/arch-release]=pacman
osInfo[/etc/gentoo-release]=emerge
osInfo[/etc/SuSE-release]=zypp
osInfo[/etc/debian_version]=apt-get
for f in ${!osInfo[@]}; do
if [ -f $f ]; then
ag=${osInfo[$f]};
fi
done;
echo "package manager $ag";
declare -a packages;
packages=( git ruby rake zsh vim fontconfig tree lnav htop tree tmux )
for i in ${packages[@]}; do
if ! [ -x "$(command -v $i)" ]; then
sudo $ag install -y $i
else
echo "-- $i already installed ---"
fi
done
elif [[ $unamestr == 'Darwin' ]]; then
platform='darwin'
which -s brew
if [[ $? != 0 ]]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "--- brew is already isntalled ---"
fi
fi
echo "Installing jesson's dot files to .gzn"
git clone --depth=1 https://github.com/jessonfoo/dotfiles.git "$HOME/.gzn"
gzn="$HOME/.gzn"
cd $gzn
rake install
else
echo "the directory .gzn already exists, to install or update cd ~/.gzn && rake update"
fi