feat: add support apt-rpm for install script
This commit is contained in:
parent
6ac1328970
commit
d7bd96ea39
@ -25,6 +25,7 @@ installPkg() {
|
||||
pacman) $rootCmd pacman --noconfirm -U ${@:2} ;;
|
||||
apk) $rootCmd apk add --allow-untrusted ${@:2} ;;
|
||||
zypper) $rootCmd zypper --no-gpg-checks install ${@:2} ;;
|
||||
apt-rpm) $rootCmd apt-get install -y ${@:2} ;;
|
||||
*) $rootCmd $1 install -y ${@:2} ;;
|
||||
esac
|
||||
}
|
||||
@ -59,6 +60,10 @@ elif command -v apk &>/dev/null; then
|
||||
info "Обнаружен apk"
|
||||
pkgFormat="apk"
|
||||
pkgMgr="apk"
|
||||
elif command -v apt-config &>/dev/null && apt-config dump | grep -q "RPM"; then
|
||||
info "Обнаружен apt-rpm"
|
||||
pkgFormat="rpm"
|
||||
pkgMgr="apt-rpm"
|
||||
else
|
||||
warn "Не обнаружен поддерживаемый менеджер пакетов!"
|
||||
noPkgMgr=true
|
||||
@ -78,7 +83,7 @@ if [ -z "$noPkgMgr" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*.pkg.tar.zst' | sort -V | tail -n 1)
|
||||
elif [ "$pkgMgr" == "apt" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*.amd64.deb' | sort -V | tail -n 1)
|
||||
elif [[ "$pkgMgr" == "dnf" || "$pkgMgr" == "yum" || "$pkgMgr" == "zypper" ]]; then
|
||||
elif [ "$pkgFormat" == "rpm" ]; then
|
||||
latestFile=$(echo "$fileList" | grep -E 'alr-bin-.*.x86_64.rpm' | sort -V | tail -n 1)
|
||||
else
|
||||
error "Не поддерживаемый менеджер пакетов для автоматической установки"
|
||||
|
Loading…
Reference in New Issue
Block a user