correction

This commit is contained in:
2024-05-24 09:46:20 -05:00
parent 7e69257fd5
commit b651eb4eb5
+46 -25
View File
@@ -74,30 +74,46 @@ checkEnv() {
installDepend() { installDepend() {
## Check for dependencies. ## Check for dependencies.
DEPENDENCIES='bash bash-completion tar neovim bat tree multitail fastfetch' DEPENDENCIES='bash bash-completion tar neovim bat tree multitail'
echo -e "${YELLOW}Installing dependencies...${RC}" echo -e "${YELLOW}Installing dependencies...${RC}"
if [ "$PACKAGER" = "pacman" ]; then if [ "$PACKAGER" = "nala" ] || [ "$PACKAGER" = "apt" ]; then
if ! command_exists yay && ! command_exists paru; then for pkg in $DEPENDENCIES; do
echo "Installing yay as AUR helper..." read -p "Would you like to install $pkg package? [Y/n]: " choice
sudo pacman --noconfirm -S base-devel case "$choice" in
cd /opt && sudo git clone https://aur.archlinux.org/yay-git.git && sudo chown -R "${USER}:${USER}" ./yay-git y|Y|'') sudo "$PACKAGER" install -y "$pkg" ;;
cd yay-git && makepkg --noconfirm -si n|N) ;;
else *) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" install -y "$pkg" ;;
echo "Aur helper already installed" esac
fi done
if command_exists yay; then elif [ "$PACKAGER" = "yum" ] || [ "$PACKAGER" = "dnf" ]; then
AUR_HELPER="yay" for pkg in $DEPENDENCIES; do
elif command_exists paru; then read -p "Would you like to install $pkg package? [Y/n]: " choice
AUR_HELPER="paru" case "$choice" in
else y|Y|'') sudo "$PACKAGER" install -y "$pkg" ;;
echo "No AUR helper found. Please install yay or paru." n|N) ;;
exit 1 *) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" install -y "$pkg" ;;
fi esac
"${AUR_HELPER}" --noconfirm -S ${DEPENDENCIES} done
elif [ "$PACKAGER" = "nala" ] || [ "$PACKAGER" = "apt" ]; then elif [ "$PACKAGER" = "pacman" ]; then
sudo "$PACKAGER" install -y ${DEPENDENCIES} for pkg in $DEPENDENCIES; do
read -p "Would you like to install $pkg package? [Y/n]: " choice
case "$choice" in
y|Y|'') sudo "$PACKAGER" -S --noconfirm "$pkg" ;;
n|N) ;;
*) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" -S --noconfirm "$pkg" ;;
esac
done
elif [ "$PACKAGER" = "zypper" ]; then
for pkg in $DEPENDENCIES; do
read -p "Would you like to install $pkg package? [Y/n]: " choice
case "$choice" in
y|Y|'') sudo "$PACKAGER" install -y "$pkg" ;;
n|N) ;;
*) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" install -y "$pkg" ;;
esac
done
else else
sudo "$PACKAGER" install -yq ${DEPENDENCIES} echo "Unsupported package manager: $PACKAGER"
fi fi
} }
@@ -140,9 +156,14 @@ installFastfetch() {
return return
fi fi
if ! curl -sSL https://github.com/fastfetch-cli/fastfetch/releases/download/2.13.2/fastfetch-linux-amd64.deb -o fastfetch-linux-amd64.deb || ! sudo dpkg -i fastfetch-linux-amd64.deb; then echo -e "${YELLOW}Installing fastfetch...${RC}"
echo -e "${RED}Something went wrong during fastfetch install${RC}" if [ "$PACKAGER" = "nala" ] || [ "$PACKAGER" = "apt" ]; then
exit 1 if ! curl -sSL https://github.com/fastfetch-cli/fastfetch/releases/download/2.13.2/fastfetch-linux-amd64.deb -o fastfetch-linux-amd64.deb || ! sudo dpkg -i fastfetch-linux-amd64.deb; then
echo -e "${RED}Something went wrong during fastfetch install${RC}"
exit 1
fi
else
sudo "$PACKAGER" install -y fastfetch
fi fi
} }