forked from mitochondrion/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_from_web.sh
30 lines (30 loc) · 967 Bytes
/
install_from_web.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
#!/bin/bash
# meant for onliner install, like
# curl -L https://github.com/turvas/dotfiles/raw/master/install_from_web.sh | sh
#
set -e
which git > /dev/null
if [ $? -gt 0 ]; then # missing
OS=`uname | awk '{print $1}'`
if [ "$OS" = "Linux" ]; then # need more exact flavor
OS=$(cat /etc/*release | grep '^ID=' | cut -c 4- | sed "s/\"//g")
fi
echo Installing for: $OS
if [ "$OS" = "ubuntu" ] || [ "$OS" = "debian" ]; then
sudo apt update
sudo apt install -y git
elif [ "$OS" = "FreeBSD" ]; then
echo y | sudo pkg install git
else # centos, fedore rhel
sudo yum install -y git
fi
fi
if [ -z "$1" ]; then
[email protected]/turvas
else
GIT_REPO=$1
fi
git clone https://$GIT_REPO/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
./install_dotfiles.sh # Don't worry, this will preserve existing dotfiles with timestamps!
source ~/.bash_profile # Apply new dotfiles to current shell