Update package managers to work properly more often
This commit is contained in:
parent
b0d81f4f0e
commit
c76d0fcd11
4 changed files with 16 additions and 26 deletions
|
@ -12,23 +12,23 @@ EMAIL="dev@askiiart.net"
|
||||||
command_exists() { type "$1" &>/dev/null; }
|
command_exists() { type "$1" &>/dev/null; }
|
||||||
|
|
||||||
if command_exists "apt-get"; then
|
if command_exists "apt-get"; then
|
||||||
PM="apt-get"
|
apt-get install pass git -y
|
||||||
elif command_exists "yum"; then
|
elif command_exists "yum"; then
|
||||||
PM="yum"
|
yum install pass git -y
|
||||||
elif command_exists "pacman"; then
|
elif command_exists "pacman"; then
|
||||||
PM="pacman"
|
pacman -S git --noconfirm
|
||||||
|
pacman -S pass --noconfirm
|
||||||
elif command_exists "zypp"; then
|
elif command_exists "zypp"; then
|
||||||
PM="zypp"
|
zypper install pass git -y
|
||||||
elif command_exists "emerge"; then
|
elif command_exists "emerge"; then
|
||||||
PM="emerge"
|
echo Not yet supported, exiting...
|
||||||
elif command_exists "apk"; then
|
elif command_exists "apk"; then
|
||||||
PM="apk"
|
apk add pass
|
||||||
|
apk add git
|
||||||
else
|
else
|
||||||
echo "Unsupported: unknown package manager"
|
echo "Unsupported: unknown package manager"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo ${PM} install pass git -y
|
|
||||||
|
|
||||||
# Check if GCM is installed
|
# Check if GCM is installed
|
||||||
if [ -f "${HOME}/.git-credentials" ]; then
|
if [ -f "${HOME}/.git-credentials" ]; then
|
||||||
echo "Git Credential Manager already installed, skipping..."
|
echo "Git Credential Manager already installed, skipping..."
|
||||||
|
|
10
test.bash
10
test.bash
|
@ -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
|
|
|
@ -22,9 +22,9 @@ elif command_exists "emerge"; then
|
||||||
$SUDO emerge --ask app-shells/zsh-completions
|
$SUDO emerge --ask app-shells/zsh-completions
|
||||||
$SUDO emerge --ask app-shells/gentoo-zsh-completions
|
$SUDO emerge --ask app-shells/gentoo-zsh-completions
|
||||||
elif command_exists "apk"; then
|
elif command_exists "apk"; then
|
||||||
$SUDO apk add zsh -y;
|
$SUDO apk add zsh -y
|
||||||
else
|
else
|
||||||
>&2 echo "Unsupported: unknown package manager"
|
echo >&2 "Unsupported: unknown package manager"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue