helm/base/arch/_init

44 lines
873 B
Bash
Executable file

#!/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 yay (AUR helper)
if ! _is_callable yay; then
git clone https://aur.archlinux.org/yay.git /tmp/yay
pushd /tmp/yay
makepkg -si
popd
rm -rf /tmp/yay
if ! _is_callable yay; then
>&2 echo "Yay was not successfully installed"
return 3
fi
fi
yay --needed --noconfirm -S ripgrep the_silver_searcher bc cronie
sudo systemctl enable cronie
}
update() {
_is_callable yay && local pac=yay
${pac:-sudo pacman} -Syu --noconfirm
}
# link() {}
# clean() {}
init "$@"