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
|
|
|
|
|
|
|
|
# Set up pacaur (AUR helper)
|
|
|
|
if ! _is_callable pacaur; then
|
|
|
|
TEMP="$(mktemp -d)"
|
|
|
|
pushd $TEMP
|
|
|
|
for pkg in cower pacaur; do
|
|
|
|
if [[ ! "$(pacman -Qs $pkg)" ]]; then
|
|
|
|
curl -o PKGBUILD https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=$pkg && \
|
|
|
|
makepkg PKGBUILD --needed --noconfirm --skippgpcheck -sri
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
rm -rf $TEMP
|
|
|
|
|
|
|
|
if ! _is_callable pacaur; then
|
|
|
|
>&2 echo "Pacaur was not successfully installed"
|
|
|
|
return 3
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-12-13 15:28:21 -08:00
|
|
|
pacaur --needed --noconfirm --noedit -S ripgrep the_silver_searcher bc cronie
|
2017-12-05 22:39:10 -08:00
|
|
|
sudo systemctl enable cronie
|
|
|
|
}
|
|
|
|
|
|
|
|
update() {
|
|
|
|
_is_callable pacaur && local pac=pacaur
|
|
|
|
${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 "$@"
|