fixed some settings
This commit is contained in:
parent
1866ec3bc5
commit
d62d9b66f2
1 changed files with 27 additions and 16 deletions
29
distros.sh
29
distros.sh
|
@ -52,7 +52,17 @@ run() {
|
|||
}
|
||||
|
||||
checkAndInstall() {
|
||||
echo "DEBUG:: GOT ARRAY :: ${@}"
|
||||
# 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 $1 - as it's already installed.."
|
||||
fi
|
||||
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
|
||||
|
@ -62,6 +72,7 @@ checkAndInstall() {
|
|||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue