added a preliminary check to ensure fzf is installed in the installation

script
This commit is contained in:
aminnairi
2024-01-06 11:26:32 +01:00
parent 1bfe53effe
commit 91b6cd8f1d
+13
View File
@@ -13,6 +13,7 @@ ERROR_BECAUSE_ROOT=1
ERROR_BECAUSE_NOT_ARCH_LINUX=2 ERROR_BECAUSE_NOT_ARCH_LINUX=2
ERROR_BECAUSE_TOO_MUCH_ARGUMENTS_PROVDED=3 ERROR_BECAUSE_TOO_MUCH_ARGUMENTS_PROVDED=3
ERROR_BECAUSE_ANSIBLE_INSTALLATION_FAILED=4 ERROR_BECAUSE_ANSIBLE_INSTALLATION_FAILED=4
ERRROR_BECAUSE_FUZZY_FILE_FINDER_INSTALLATION_FAILED=5
ERROR_BECAUSE_PLAYBOOK_PATH_DOES_NOT_EXIST=6 ERROR_BECAUSE_PLAYBOOK_PATH_DOES_NOT_EXIST=6
if [[ "$(id -u)" -eq 0 ]] if [[ "$(id -u)" -eq 0 ]]
@@ -41,6 +42,18 @@ then
fi fi
fi fi
if [[ ! -x "$(command -v fzf)" ]]
then
echo "Fuzzy file finder not found, installing..."
if [[ ! "$(sudo pacman -Syy --noconfirm fzf)" ]]
then
echo "Installation of fuzzy file finder failed."
display_help
exit $ERRROR_BECAUSE_FUZZY_FILE_FINDER_INSTALLATION_FAILED
fi
fi
if [[ $# -gt 1 ]] if [[ $# -gt 1 ]]
then then
echo "Too much arguments provided." echo "Too much arguments provided."