Update package managers to work properly more often

This commit is contained in:
askiiart 2023-08-28 18:01:19 -05:00
parent b0d81f4f0e
commit c76d0fcd11
No known key found for this signature in database
GPG key ID: 85505F3A2264FA01
4 changed files with 16 additions and 26 deletions

View file

@ -12,23 +12,23 @@ EMAIL="dev@askiiart.net"
command_exists() { type "$1" &>/dev/null; }
if command_exists "apt-get"; then
PM="apt-get"
apt-get install pass git -y
elif command_exists "yum"; then
PM="yum"
yum install pass git -y
elif command_exists "pacman"; then
PM="pacman"
pacman -S git --noconfirm
pacman -S pass --noconfirm
elif command_exists "zypp"; then
PM="zypp"
zypper install pass git -y
elif command_exists "emerge"; then
PM="emerge"
echo Not yet supported, exiting...
elif command_exists "apk"; then
PM="apk"
apk add pass
apk add git
else
echo "Unsupported: unknown package manager"
fi
sudo ${PM} install pass git -y
# Check if GCM is installed
if [ -f "${HOME}/.git-credentials" ]; then
echo "Git Credential Manager already installed, skipping..."

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
type "$1" &> /dev/null; }
if command_exists "apt-get"; then
PM="apt-get"
elif command_exists "yum"; then
PM="yum"
fi
echo $PM

View file

@ -22,9 +22,9 @@ elif command_exists "emerge"; then
$SUDO emerge --ask app-shells/zsh-completions
$SUDO emerge --ask app-shells/gentoo-zsh-completions
elif command_exists "apk"; then
$SUDO apk add zsh -y;
$SUDO apk add zsh -y
else
>&2 echo "Unsupported: unknown package manager"
echo >&2 "Unsupported: unknown package manager"
exit 1
fi