-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuse.sh
executable file
·76 lines (69 loc) · 1.65 KB
/
use.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
#!/bin/bash
# apt installations - darwin based systems
if [ -x "$(command -v apt-get)" ]
then
apt_installations=(
"tmux"
"cmake"
"apt-transport-https"
"wget"
"ca-certificates"
"software-properties-common"
"snapd"
"git"
"xclip"
"net-tools"
)
apt_cache_prefix="installed-apt-"
to_install=""
for pkg in "${apt_installations[@]}"
do
if [ "$(zetup cache get $apt_cache_prefix$pkg)" != "true" ]
then
to_install="$to_install $pkg"
fi
done
if [ -n "${to_install}" ]
then
sudo apt-get update
sh -c "sudo apt install $to_install -yqq" && \
for pkg in "${apt_installations[@]}"
do
zetup cache set "$apt_cache_prefix$pkg" true
done
fi
fi
if [ -x "$(command -v snap)" ]
then
apt_installations=(
"yq"
)
to_install=""
snap_cache_prefix="installed-snap"
for pkg in "${apt_installations[@]}"
do
if [ "$(zetup cache get $snap_cache_prefix$pkg)" != "true" ]
then
sudo snap install "$pkg" && \
zetup cache set "$snap_cache_prefix$pkg" true
fi
done
fi
# install brew on mac
if [ "$(uname)" == "darwin" ]
then
if [ ! -x "$(command -v brew)" ]
then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
fi
zetup link "$ZETUP_USE_PKG/dotfiles/bashrc.sh" "$HOME/.bashrc"
zetup link "$ZETUP_USE_PKG/dotfiles/aliases.sh" "$HOME/.aliases"
zetup link "$ZETUP_USE_PKG/dotfiles/fns.sh" "$HOME/.fns"
zetup link "$ZETUP_USE_PKG/dotfiles/tmux.conf" "$HOME/.tmux.conf"
zetup link "$ZETUP_USE_PKG/dotfiles/vimrc" "$HOME/.vimrc"
source "$HOME/.bashrc"
for f in "$ZETUP_USE_PKG"/subpkg/*/use.sh
do
bash $f
done