sort BIN_PATHS before process (#510)

This commit is contained in:
mslifcak 2018-01-17 07:49:07 -05:00 committed by Michael Boelen
parent f79cb08db3
commit 2c774b8795
1 changed files with 3 additions and 2 deletions

View File

@ -44,8 +44,8 @@
# Test if our PATH variable provides a set of paths (otherwise we use predefined list in include/consts)
if [ ! -z "${PATH}" ]; then BIN_PATHS=$(echo ${PATH} | tr ':' ' '); fi
for SCANDIR in ${BIN_PATHS}; do
SORTED_BIN_PATHS=$(echo ${BIN_PATHS} | tr ' ' '\n' | sort | tr '\n' ' ')
for SCANDIR in ${SORTED_BIN_PATHS}; do
LogText "Test: Checking binaries in directory ${SCANDIR}"
ORGPATH=""
if [ -d ${SCANDIR} ]; then
@ -277,6 +277,7 @@
LogText "Result: Directory ${SCANDIR} does NOT exist"
fi
done
unset SORTED_BIN_PATHS
BINARY_SCAN_FINISHED=1
BINARY_PATHS_FOUND=$(echo ${BINARY_PATHS_FOUND} | sed 's/^, //g' | sed 's/ //g')
LogText "Discovered directories: ${BINARY_PATHS_FOUND}"