-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·50 lines (42 loc) · 1.43 KB
/
setup.sh
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
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# Source the Conda configuration
CONDA_BASE=$(conda info --base)
source "$CONDA_BASE/etc/profile.d/conda.sh"
# Check if the environment already exists
conda info --envs | grep -w "$ENV_NAME" > /dev/null
if [ $? -eq 0 ]; then
echo "Activating Conda environment $ENV_NAME"
conda activate "$ENV_NAME"
else
echo "Creating and activating new Conda environment $ENV_NAME with Python 3.7"
conda create -n "$ENV_NAME" python=3.8
conda activate "$ENV_NAME"
fi
# install phishintention
PACKAGE_NAME="phishintention"
installed_packages=$(conda run -n "$ENV_NAME" conda list)
if echo "$installed_packages" | grep -q "$PACKAGE_NAME"; then
echo "PhishIntention is already installed, skip installation"
else
git clone -b development --single-branch https://github.com/lindsey98/PhishIntention.git
cd PhishIntention
chmod +x ./setup.sh
export ENV_NAME="$ENV_NAME" && ../setup.sh
cd ../
rm -rf PhishIntention
fi
## Install MyXDriver
PACKAGE_NAME="xdriver"
installed_packages=$(conda run -n "$ENV_NAME" conda list)
if echo "$installed_packages" | grep -q "$PACKAGE_NAME"; then
echo "MyXdriver_pub is already installed, skip installation"
else
git clone https://github.com/lindsey98/MyXdriver_pub.git
cd MyXdriver_pub
chmod +x ./setup.sh
export ENV_NAME="$ENV_NAME" && ./setup.sh
cd ../
fi
# Install other requirements
conda run -n "$ENV_NAME" pip install -r requirements.txt
echo "All packages installed successfully!"