mirror of
https://github.com/alvinlollo/Single-install-script.git
synced 2026-06-14 18:59:43 +10:00
Avoid package manager exit 1
The script will now skip the installation of the dependencies if they are already installed to avoid the script exiting early.
This commit is contained in:
@@ -26,16 +26,18 @@ echo "This script will backup your current zsh config if it exists "
|
|||||||
# Enable exit on error
|
# Enable exit on error
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Install prerequisites
|
# Install prerequisites if installed skips
|
||||||
|
|
||||||
if command -v pacman >/dev/null; then
|
if ! command -v zsh >/dev/null && command -v git >/dev/null && command -v curl >/dev/null && command -v fzf >/dev/null; then
|
||||||
echo "pacman detected. Installing prerequisites"
|
if command -v pacman >/dev/null; then
|
||||||
sudo pacman -S zsh git curl fzf --noconfirm
|
echo "pacman detected. Installing prerequisites"
|
||||||
fi
|
sudo pacman -S zsh git curl fzf --noconfirm
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v apt >/dev/null; then
|
if command -v apt >/dev/null; then
|
||||||
echo "apt detected. Installing prerequisites"
|
echo "apt detected. Installing prerequisites"
|
||||||
sudo apt install git curl zsh fzf -y
|
sudo apt install git curl zsh fzf -y
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
zsh=$(which zsh)
|
zsh=$(which zsh)
|
||||||
|
|||||||
Reference in New Issue
Block a user