Up.
This commit is contained in:
parent
5c115f48f5
commit
97c9c2330a
@ -1,17 +1,17 @@
|
||||
#!{{ lookPath "bash" }}
|
||||
|
||||
# Logging function
|
||||
log() {
|
||||
printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
|
||||
}
|
||||
# log() {
|
||||
# printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
|
||||
# }
|
||||
|
||||
inf() {
|
||||
printf "$(tput setaf 2)╚═══ᐳ $(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
|
||||
}
|
||||
# inf() {
|
||||
# printf "$(tput setaf 2)╚═══ᐳ $(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
|
||||
# }
|
||||
|
||||
err() {
|
||||
printf "$(tput setaf 9)$(tput bold)>>>>> %s ! <<<<<$(tput sgr0)\n" "$1"
|
||||
}
|
||||
# err() {
|
||||
# printf "$(tput setaf 9)$(tput bold)>>>>> %s ! <<<<<$(tput sgr0)\n" "$1"
|
||||
# }
|
||||
|
||||
|
||||
{{ if (eq .chezmoi.os "linux") -}}
|
||||
|
@ -23,21 +23,19 @@ packages=(
|
||||
|
||||
|
||||
## Update system
|
||||
inf "Updating system..."
|
||||
inf "updating system..."
|
||||
sudo pacman -Syu --noconfirm --quiet
|
||||
|
||||
## Install yay
|
||||
if [ ! $(command -v yay) ]; then
|
||||
inf "Installing yay..."
|
||||
install_binary "yay"
|
||||
install_binary "yay"
|
||||
fi
|
||||
|
||||
## Install packages
|
||||
for package in ${packages[@]}; do
|
||||
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
||||
inf "Installing ${package}..."
|
||||
install_binary $package "yay"
|
||||
fi
|
||||
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
||||
install_binary $package "yay"
|
||||
else
|
||||
inf "${package} already installed."
|
||||
fi
|
||||
done
|
||||
|
||||
inf "Packages installed."
|
@ -6,7 +6,7 @@ log() {
|
||||
}
|
||||
|
||||
inf() {
|
||||
printf "$(tput setaf 2)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
|
||||
printf "$(tput setaf 2)╚═══ᐳ $(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
|
||||
}
|
||||
|
||||
err() {
|
||||
@ -45,7 +45,7 @@ install_binary() {
|
||||
fi
|
||||
|
||||
# Install the package using the determined or specified package manager
|
||||
inf "Installing ${package_name} using ${package_manager}..."
|
||||
inf "installing ${package_name} using ${package_manager}..."
|
||||
|
||||
case "${package_manager}" in
|
||||
apt-get)
|
||||
@ -56,7 +56,7 @@ install_binary() {
|
||||
;;
|
||||
pacman)
|
||||
sudo pacman -S --needed --noconfirm --quiet "${package_name}" || {
|
||||
err "ERROR" "Installation failed."
|
||||
err "Installation failed."
|
||||
exit 1
|
||||
}
|
||||
;;
|
||||
@ -77,7 +77,7 @@ install_binary() {
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
inf "Installation of ${package_name} completed successfully."
|
||||
inf "installation of ${package_name} completed successfully."
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user