forked from STOCD/SETS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (53 loc) · 1.32 KB
/
install.sh
File metadata and controls
executable file
·53 lines (53 loc) · 1.32 KB
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
50
51
52
53
#!/bin/sh
if [ ! -r . ] || [ ! -w . ]
then
echo "[Error] The current folder must be readable and writable."
exit
fi
python3 --version > /dev/null 2>&1
if [ $? != 0 ]
then
echo "[Error] No python installation found! Install python 3 to continue."
exit
fi
python3 -m pip --version > /dev/null 2>&1
if [ $? != 0 ]
then
echo "[Error] No PIP installation could be found! Install PIP to continue."
exit
fi
if [ ! -e ".venv/bin/activate" ]
then
echo "[Info] No virtual environment found. Creating virtual environment ..."
python3 -m venv ".venv" > /dev/null 2>&1
if [ $? != 0 ]
then
echo "[Error] Virtual environment creation failed. If this error persists,"\
"please manually create a python virtual environment in a folder named"\
"\".venv\"."
fi
fi
. ".venv/bin/activate"
python3 -m pip install -e .
if [ $? != 0 ]
then
echo "[Error] Package installation failed. Please refer to the error message above"
exit
fi
deactivate
if [ -d ".config" ]
then
if [ ! -d ".config/images" ]
then
echo "[Info] Creating folder \".config/images\"."
mkdir .config/images
fi
else
echo "[Info] Creating folders \".config\" and \".config/images\"."
mkdir .config
mkdir .config/images
fi
if [ $? = 0 ]
then
echo "[Info] Installation successful!"
fi