fixed some settings
This commit is contained in:
parent
1866ec3bc5
commit
d62d9b66f2
1 changed files with 27 additions and 16 deletions
43
distros.sh
43
distros.sh
|
@ -52,16 +52,27 @@ run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkAndInstall() {
|
checkAndInstall() {
|
||||||
echo "DEBUG:: GOT ARRAY :: ${@}"
|
# echo "DEBUG:: GOT ARRAY :: ${@}"
|
||||||
for deps in "${@}"; do
|
# ─< if it's not a list, then just check and install the package.. >──────────────────────
|
||||||
echo_info "Installing $deps"
|
if [ -z "$2" ]; then
|
||||||
if ! command_exists $deps; then
|
if ! command_exists "$1"; then
|
||||||
echo_note "$deps is not installed. Installing it now.."
|
echo_note "$1 is not installed. Installing it now.."
|
||||||
run _install "$deps"
|
run _install "$1"
|
||||||
else
|
else
|
||||||
echo_note "skipping $deps - as it's already installed.."
|
echo_note "skipping $1 - as it's already installed.."
|
||||||
fi
|
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 >───────────────────────
|
# ─< 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 "Can not detect distribution correctly!"
|
||||||
echo_error "DEBUG:: $pkger ::"
|
# echo_error "DEBUG:: $pkger ::"
|
||||||
return 69
|
return 69
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -246,19 +257,19 @@ get_packager() {
|
||||||
update_package_list() {
|
update_package_list() {
|
||||||
echo_note "Refreshing repositories.."
|
echo_note "Refreshing repositories.."
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
ubuntu | debian) silentexec $_sudo apt-get update ;;
|
ubuntu | debian) run $_sudo apt-get update ;;
|
||||||
fedora) silentexec $_sudo dnf update ;;
|
fedora) run $_sudo dnf update ;;
|
||||||
arch)
|
arch)
|
||||||
if command_exists paru; then
|
if command_exists paru; then
|
||||||
silentexec paru -Sy
|
run paru -Sy
|
||||||
elif command_exists yay; then
|
elif command_exists yay; then
|
||||||
silentexec yay -Sy
|
run yay -Sy
|
||||||
else
|
else
|
||||||
silentexec $_sudo pacman -Sy
|
run $_sudo pacman -Sy
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
opensuse) silentexec $_sudo zypper ref ;;
|
opensuse) run $_sudo zypper ref ;;
|
||||||
alpine) silentexec $_sudo apk update ;;
|
alpine) run $_sudo apk update ;;
|
||||||
*) echo_error "Unsupported distribution: $distro" ;;
|
*) echo_error "Unsupported distribution: $distro" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue