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

@@ -39,8 +39,26 @@ WP_DRIVER="DXVK"
# Reset the logfile-value for the installation of Autodesk Fusion 360! # Reset the logfile-value for the installation of Autodesk Fusion 360!
SP_FUSION360_CHANGE=0 SP_FUSION360_CHANGE=0
REQUIRED_COMMANDS=(
"yad"
"wine"
)
############################################################################################################################################################### ###############################################################################################################################################################
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
}
function SP_STRUCTURE { function SP_STRUCTURE {
mkdir -p "$SP_PATH/bin" mkdir -p "$SP_PATH/bin"
mkdir -p "$SP_PATH/logs" mkdir -p "$SP_PATH/logs"
@@ -1153,6 +1171,7 @@ function SP_COMPLETED {
# THE INSTALLATION PROGRAM IS STARTED HERE: # # THE INSTALLATION PROGRAM IS STARTED HERE: #
############################################################################################################################################################### ###############################################################################################################################################################
SP_CHECK_REQUIRED_COMMANDS
SP_STRUCTURE SP_STRUCTURE
SP_LOGFILE_INSTALL SP_LOGFILE_INSTALL
SP_LOCALE_INDEX SP_LOCALE_INDEX

View File

@@ -20,8 +20,25 @@
# Default-Path: # Default-Path:
DL_PATH="$HOME/.fusion360" 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. # Copy the file where the user can see the exits Wineprefixes of Autodesk Fusion 360 on the system.
function DL_GET_FILES { function DL_GET_FILES {
mkdir -p "/tmp/fusion360/logs" mkdir -p "/tmp/fusion360/logs"
@@ -204,6 +221,7 @@ function DL_WINEPREFIXES_DEL_INFO {
# THE INSTALLATION PROGRAM IS STARTED HERE: # # THE INSTALLATION PROGRAM IS STARTED HERE: #
############################################################################################################################################################### ###############################################################################################################################################################
SP_CHECK_REQUIRED_COMMANDS
DL_GET_FILES DL_GET_FILES
DL_LOAD_LOCALE DL_LOAD_LOCALE
DL_WELCOME DL_WELCOME