-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmlviewer_macos.sh
More file actions
executable file
·38 lines (31 loc) · 872 Bytes
/
mlviewer_macos.sh
File metadata and controls
executable file
·38 lines (31 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Use python3 if python is not available
if command -v python &> /dev/null; then
PYTHON_CMD=python
elif command -v python3 &> /dev/null; then
PYTHON_CMD=python3
else
echo "Need to install python >= 3.8.0 to run mlviewer."
exit 1
fi
# Check if installed python version is 3.8.0+
if [ "$(${PYTHON_CMD} -c 'import sys; print(sys.version_info >= (3, 8))')" != "True" ]; then
echo "Python 3.8.0+ is required."
exit 1
fi
# Check if the virtual environment already exists
if [ ! -d "venv" ]; then
# Create python virtual environment
${PYTHON_CMD} -m venv ./venv
# Activate venv
source venv/bin/activate
# Install requirements
pip install -r requirements.txt
# Install capstone based on architecture
pip install capstone
else
# Activate venv
source venv/bin/activate
fi
# Run
${PYTHON_CMD} main.py