2017-12-05 22:39:10 -08:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
source ${0:A:h}/../../deploy
|
|
|
|
|
|
|
|
install() {
|
|
|
|
if ! nc -z 8.8.8.8 53 >/dev/null 2>&1; then
|
|
|
|
>&2 echo "No internet connection"
|
|
|
|
return 1
|
|
|
|
elif ! sudo pacman -Syu --noconfirm; then
|
|
|
|
>&2 echo "Could not update pacman"
|
|
|
|
return 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Core essentials
|
|
|
|
sudo pacman --needed --noconfirm -S wget git curl tree rsync dnsutils
|
|
|
|
|
2018-05-24 12:35:12 -07:00
|
|
|
# Set up yay (AUR helper)
|
|
|
|
if ! _is_callable yay; then
|
|
|
|
git clone https://aur.archlinux.org/yay.git /tmp/yay
|
|
|
|
pushd /tmp/yay
|
|
|
|
makepkg -si
|
2017-12-05 22:39:10 -08:00
|
|
|
popd
|
2018-05-24 12:35:12 -07:00
|
|
|
rm -rf /tmp/yay
|
2017-12-05 22:39:10 -08:00
|
|
|
|
2018-05-24 12:35:12 -07:00
|
|
|
if ! _is_callable yay; then
|
|
|
|
>&2 echo "Yay was not successfully installed"
|
2017-12-05 22:39:10 -08:00
|
|
|
return 3
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-05-24 12:35:12 -07:00
|
|
|
yay --needed --noconfirm -S ripgrep the_silver_searcher bc cronie
|
2017-12-05 22:39:10 -08:00
|
|
|
sudo systemctl enable cronie
|
|
|
|
}
|
|
|
|
|
|
|
|
update() {
|
2018-05-24 12:35:12 -07:00
|
|
|
_is_callable yay && local pac=yay
|
2017-12-05 22:39:10 -08:00
|
|
|
${pac:-sudo pacman} -Syu --noconfirm
|
|
|
|
}
|
|
|
|
|
2017-12-13 15:28:21 -08:00
|
|
|
# link() {}
|
2017-12-05 22:39:10 -08:00
|
|
|
|
2017-12-13 15:28:21 -08:00
|
|
|
# clean() {}
|
2017-12-05 22:39:10 -08:00
|
|
|
|
|
|
|
init "$@"
|