Chg [build] dependency check

This commit is contained in:
niclas 2024-02-07 10:34:55 +01:00
parent 9bd54378a6
commit ee834867b7

View file

@ -1,23 +1,20 @@
#!/bin/bash #!/bin/bash
requirements_path="requirements.txt" requirements_path="requirements.txt"
missing_deps=0
while IFS= read -r line || [[ -n "$line" ]]; do pip freeze > installed.txt
echo "$line" | grep -F -f - <(pip freeze) diff -u <(sort $requirements_path) <(sort installed.txt)
if [ $? -ne 0 ]; then
echo "Missing or incorrect version: $line"
((missing_deps++))
fi
done < "$requirements_path"
if [ $missing_deps -eq 0 ]; then if [ $? -eq 0 ]; then
echo "All dependencies are installed with correct versions." echo "All dependencies are installed with correct versions."
else 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 exit 1
fi fi
rm installed.txt # Clean up
python3 generator.py python3 generator.py
cd ./site/ || exit cd ./site/ || exit
mkdocs build mkdocs build