Tool checking optimization

This commit is contained in:
AGG2017 2024-02-17 08:51:11 -05:00
parent 6e2d40fc18
commit 3b77a2cefa
10 changed files with 78 additions and 121 deletions

View file

@ -14,19 +14,14 @@ project_root="$1"
python_package="$2"
# check the required tools
TOOL_LIST=("unzip")
i=0
part_num=${#TOOL_LIST[*]}
while [ $i -lt $((part_num)) ]; do
echo "Checking tool: ${TOOL_LIST[$i]}"
t=$(which "${TOOL_LIST[$i]}")
if [ -z "$t" ]; then
if [ ! -f "$project_root/TOOLS/${TOOL_LIST[$i]}" ]; then
echo -e "${RED}ERROR: Missing tool '${TOOL_LIST[$i]}' ${NC}"
exit 2
fi
TOOL_LIST="unzip"
for tool_name in $TOOL_LIST; do
echo "Checking tool: $tool_name"
tool_path=$(which "$tool_name")
if [ -z "$tool_path" ]; then
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
exit 1
fi
i=$(($i + 1))
done
# check the project root folder