-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.bash
executable file
·53 lines (40 loc) · 1011 Bytes
/
sync.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
#!/usr/bin/env bash
set -eu -o pipefail
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
function print() {
echo -e "${green}>>>>>>>>>>>>>$1<<<<<<<<<<<<<<${reset}"
}
function installZSH() {
if [ ! -d ".oh-my-zsh/" ]; then
git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh
chsh -s /bin/zsh
fi
}
function updateZSH() {
pushd ~/.oh-my-zsh
git pull
popd
}
function freshInstall() {
print "setting up golang directory"
mkdir -p ~/workspace/go/
print "setting oh-my-zsh"
installZSH
print "setting up docker"
sudo systemctl start docker.service
sudo systemctl enable docker.service
print "setting up ssh-agent"
systemctl --user enable ssh-agent
systemctl --user start ssh-agent
}
print "updating all packages"
sudo pacman -Syu --noconfirm
print "installing listed packages"
grep -v "^#" pacman | sudo pacman -S --needed --noconfirm -
if [ ${1-nope} == "install" ]; then
freshInstall
fi
print "updating oh-my-zsh"
sudo pacman -Syu --noconfirm