post install check (#1541)

A check to verify that python requirements are installed after install.
Exodus Tracker DB update
This commit is contained in:
Ajin Abraham
2020-09-14 17:27:10 -04:00
committed by GitHub
parent 102a40e2ba
commit a020e9ea9e
5 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ logger = logging.getLogger(__name__)
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
MOBSF_VER = 'v3.1.4 Beta'
MOBSF_VER = 'v3.1.5 Beta'
BANNER = """
__ __ _ ____ _____ _____ _
+28
View File
@@ -0,0 +1,28 @@
import platform
from pkg_resources import (
DistributionNotFound,
VersionConflict,
require,
)
from pathlib import Path
plat = platform.system() != 'Windows'
red = '\033[91m' if plat else ''
end = '\033[0m' if plat else ''
bold = '\033[1m' if plat else ''
req = Path(__file__).resolve().parents[1] / 'requirements.txt'
dependencies = req.read_text().splitlines()
try:
require(dependencies)
except VersionConflict:
pass
except DistributionNotFound as exp:
print(f'{red}{bold}[ERROR] Installation Failed!{end}{red}\n'
f'Please ensure that all the requirements '
f'mentioned in documentation are installed '
f'before you run setup script.\nScroll up to see any '
f'installtion errors.\n\n{exp}{end}')
exit(1)
+1
View File
@@ -67,6 +67,7 @@ where python >nul 2>&1 && (
python manage.py migrate
echo Download and Install wkhtmltopdf for PDF Report Generation - https://wkhtmltopdf.org/downloads.html
echo [INSTALL] Installation Complete
python scripts/check_install.py
) || (
echo [ERROR] python3 is not installed
)
+1
View File
@@ -87,3 +87,4 @@ if ! [ $? -eq 0 ]; then
echo 'Download and Install wkhtmltopdf for PDF Report Generation - https://wkhtmltopdf.org/downloads.html'
fi
echo '[INSTALL] Installation Complete'
python scripts/check_install.py
File diff suppressed because one or more lines are too long