From ee834867b710324f09233cdd175d95d2889a162f Mon Sep 17 00:00:00 2001 From: niclas Date: Wed, 7 Feb 2024 10:34:55 +0100 Subject: [PATCH] Chg [build] dependency check --- tools/mkdocs/build.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/mkdocs/build.sh b/tools/mkdocs/build.sh index 26a1ba3..b69a704 100644 --- a/tools/mkdocs/build.sh +++ b/tools/mkdocs/build.sh @@ -1,23 +1,20 @@ #!/bin/bash requirements_path="requirements.txt" -missing_deps=0 -while IFS= read -r line || [[ -n "$line" ]]; do - echo "$line" | grep -F -f - <(pip freeze) - if [ $? -ne 0 ]; then - echo "Missing or incorrect version: $line" - ((missing_deps++)) - fi -done < "$requirements_path" +pip freeze > installed.txt +diff -u <(sort $requirements_path) <(sort installed.txt) -if [ $missing_deps -eq 0 ]; then +if [ $? -eq 0 ]; then echo "All dependencies are installed with correct versions." else - echo "$missing_deps dependencies are missing or have incorrect versions." + echo "Dependencies missing or with incorrect versions. Please install all dependencies from $requirements_path into your environment." + rm installed.txt # Clean up exit 1 fi +rm installed.txt # Clean up + python3 generator.py cd ./site/ || exit mkdocs build