mirror of
https://github.com/MISP/misp-galaxy.git
synced 2024-11-22 23:07:19 +00:00
Chg [build] dependency check
This commit is contained in:
parent
9bd54378a6
commit
ee834867b7
1 changed files with 7 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue