check if required binaries are on PATH before continuing with (un)install process

This commit is contained in:
Andrew Azores
2023-01-30 13:59:02 -05:00
parent 902d451be3
commit bb0bb98de1
2 changed files with 37 additions and 0 deletions

View File

@@ -20,8 +20,25 @@
# Default-Path:
DL_PATH="$HOME/.fusion360"
REQUIRED_COMMANDS=(
"yad"
)
###############################################################################################################################################################
function SP_CHECK_REQUIRED_COMMANDS {
for cmd in "${REQUIRED_COMMANDS[@]}"; do
echo "Testing presence of ${cmd} ..."
local path="$(command -v "${cmd}")"
if [ -n "${path}" ]; then
echo "Found: ${path}"
else
echo "No ${cmd} found in \$PATH!"
exit 1
fi
done
}
# Copy the file where the user can see the exits Wineprefixes of Autodesk Fusion 360 on the system.
function DL_GET_FILES {
mkdir -p "/tmp/fusion360/logs"
@@ -204,6 +221,7 @@ function DL_WINEPREFIXES_DEL_INFO {
# THE INSTALLATION PROGRAM IS STARTED HERE: #
###############################################################################################################################################################
SP_CHECK_REQUIRED_COMMANDS
DL_GET_FILES
DL_LOAD_LOCALE
DL_WELCOME