fixed some settings

This commit is contained in:
pika 2025-05-16 16:09:24 +02:00
parent 1866ec3bc5
commit d62d9b66f2

View file

@ -52,16 +52,27 @@ run() {
}
checkAndInstall() {
echo "DEBUG:: GOT ARRAY :: ${@}"
for deps in "${@}"; do
echo_info "Installing $deps"
if ! command_exists $deps; then
echo_note "$deps is not installed. Installing it now.."
run _install "$deps"
# echo "DEBUG:: GOT ARRAY :: ${@}"
# ─< if it's not a list, then just check and install the package.. >──────────────────────
if [ -z "$2" ]; then
if ! command_exists "$1"; then
echo_note "$1 is not installed. Installing it now.."
run _install "$1"
else
echo_note "skipping $deps - as it's already installed.."
echo_note "skipping $1 - as it's already installed.."
fi
done
else
# ─< else go though the list of items and do the same >───────────────────────────────────
for deps in "${@}"; do
echo_info "Installing $deps"
if ! command_exists $deps; then
echo_note "$deps is not installed. Installing it now.."
run _install "$deps"
else
echo_note "skipping $deps - as it's already installed.."
fi
done
fi
}
# ─< Check if the user is root and set sudo variable if necessary >───────────────────────
@ -231,7 +242,7 @@ get_packager() {
;;
*)
echo_error "Can not detect distribution correctly!"
echo_error "DEBUG:: $pkger ::"
# echo_error "DEBUG:: $pkger ::"
return 69
;;
esac
@ -246,19 +257,19 @@ get_packager() {
update_package_list() {
echo_note "Refreshing repositories.."
case "$distro" in
ubuntu | debian) silentexec $_sudo apt-get update ;;
fedora) silentexec $_sudo dnf update ;;
ubuntu | debian) run $_sudo apt-get update ;;
fedora) run $_sudo dnf update ;;
arch)
if command_exists paru; then
silentexec paru -Sy
run paru -Sy
elif command_exists yay; then
silentexec yay -Sy
run yay -Sy
else
silentexec $_sudo pacman -Sy
run $_sudo pacman -Sy
fi
;;
opensuse) silentexec $_sudo zypper ref ;;
alpine) silentexec $_sudo apk update ;;
opensuse) run $_sudo zypper ref ;;
alpine) run $_sudo apk update ;;
*) echo_error "Unsupported distribution: $distro" ;;
esac
}