This commit is contained in:
Stephan Raabe
2024-05-03 09:20:03 +02:00
parent cfb1f1c047
commit b6f81adc5d
5 changed files with 67 additions and 18 deletions
+22
View File
@@ -272,4 +272,26 @@ _replaceLineInFile() {
echo "ERROR: Target file not found."
sleep 2
fi
}
# ------------------------------------------------------
# System check
# ------------------------------------------------------
_commandExists() {
package="$1";
if ! type $package > /dev/null 2>&1; then
echo ":: ERROR: $package doesn't exists. Please install it with yay -S $2"
else
echo ":: OK: $package command found."
fi
}
_folderExists() {
folder="$1";
if [ ! -d $folder ]; then
echo ":: ERROR: $folder doesn't exists. $2"
else
echo ":: OK: $folder found."
fi
}