addet more checks
This commit is contained in:
parent
0a7250a420
commit
0055f21f0a
1 changed files with 46 additions and 5 deletions
51
distros.sh
51
distros.sh
|
@ -92,13 +92,13 @@ get_packager() {
|
||||||
_install() {
|
_install() {
|
||||||
if command_exists paru; then
|
if command_exists paru; then
|
||||||
echo_info "Using paru"
|
echo_info "Using paru"
|
||||||
paru -S --noconfirm "$@"
|
paru -S --color always --noconfirm --needed "$@"
|
||||||
elif command_exists yay; then
|
elif command_exists yay; then
|
||||||
echo_info "Using yay"
|
echo_info "Using yay"
|
||||||
yay -S --noconfirm "$@"
|
yay -S --color always --noconfirm --needed "$@"
|
||||||
else
|
else
|
||||||
echo_warning "Using pacman"
|
echo_warning "Using pacman"
|
||||||
$_sudo pacman -S --noconfirm "$@"
|
$_sudo pacman -S --color always --noconfirm --needed "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
|
@ -135,8 +135,49 @@ get_packager() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
echo_error "Unable to detect distribution. /etc/os-release not found."
|
echo_warning "Unable to detect distribution /etc/os-release not found."
|
||||||
exit 1
|
echo_note "Trying other methods.."
|
||||||
|
|
||||||
|
# ─────────────────────────────────────< get packager >─────────────────────────────────────
|
||||||
|
pkger=""
|
||||||
|
for pkg in apt-get dnf pacman apk zypper; do
|
||||||
|
if command_exists $pkg; then
|
||||||
|
printf "Using ${RED}${pkg}${NC} method.."
|
||||||
|
pkger="$pkg"
|
||||||
|
|
||||||
|
# break
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
case "$pkger" in
|
||||||
|
apt-get)
|
||||||
|
debian="true"
|
||||||
|
ubuntu="true"
|
||||||
|
distro="debian"
|
||||||
|
;;
|
||||||
|
dnf)
|
||||||
|
fedora="true"
|
||||||
|
distro="fedora"
|
||||||
|
;;
|
||||||
|
pacman)
|
||||||
|
arch="true"
|
||||||
|
distro="arch"
|
||||||
|
;;
|
||||||
|
alpine)
|
||||||
|
alpine="true"
|
||||||
|
distro="alpine"
|
||||||
|
;;
|
||||||
|
opensuse*)
|
||||||
|
opensuse="true"
|
||||||
|
distro="opensuse"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo_error "Can not detect distribution correctly!"
|
||||||
|
echo_error "DEBUG:: $pkger ::"
|
||||||
|
return 69
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue