2023-08-23 21:25:12 -05:00
|
|
|
#!/usr/bin/env bash
|
2023-08-21 13:13:13 -05:00
|
|
|
# Exit if there's an error
|
|
|
|
set -e
|
2023-08-20 21:35:16 -05:00
|
|
|
|
2023-08-23 21:25:12 -05:00
|
|
|
if [ $(whoami) != "root" ]; then
|
|
|
|
$SUDO = "sudo"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
command_exists() { type "$1" &> /dev/null; }
|
2023-08-20 21:35:16 -05:00
|
|
|
|
2023-08-23 21:25:12 -05:00
|
|
|
if command_exists "apt-get"; then
|
|
|
|
$SUDO apt-get install zsh -y
|
|
|
|
elif command_exists "yum"; then
|
|
|
|
$SUDO apt-get install zsh -y
|
|
|
|
elif command_exists "pacman"; then
|
|
|
|
$SUDO pacman -S zsh --noconfirm --needed
|
|
|
|
elif command_exists "zypper"; then
|
|
|
|
$SUDO zypper install zsh -y
|
|
|
|
elif command_exists "emerge"; then
|
|
|
|
$SUDO emerge --ask app-shells/zsh
|
|
|
|
$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;
|
|
|
|
else
|
|
|
|
>&2 echo "Unsupported: unknown package manager"
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-08-20 21:35:16 -05:00
|
|
|
|
|
|
|
cp -r zsh-files/* ~/
|