-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·66 lines (51 loc) · 1.16 KB
/
install.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#remove old run script if it exist
rm -f PyTorchGUI
# Check if required pip modules are available if not install them
FILE=utils/requirements.txt
UNIQUE='-={GR}=-'
#
if [ -z "$FILE" ]; then
exit;
fi;
#
for LINE in `sed "s/ /$UNIQUE/g" $FILE`; do
LINE=`echo $LINE | sed "s/$UNIQUE/ /g"`;
if python -c 'import sys; import pkgutil; fullname=(str(sys.argv[1])); exit(not pkgutil.find_loader(fullname))' $LINE; then
echo $LINE 'found'
echo 'No installation needed'
else
echo $LINE 'Not found'
pip install $LINE
fi
if [ $? -eq 0 ]; then
echo $LINE install: OK
echo
else
echo $LINE install: FAILLED
echo
fi
done;
#Create the app run script
echo "#!/bin/bash
python src/.pytorchgui.py" > PyTorchGUI
chmod 755 PyTorchGUI
if [ $? -eq 0 ]; then
echo PytTorchGUI generate: OK
echo
else
echo PyTorchGUI generate: FAILLED
echo
fi
#Create the test run script
echo "#!/bin/bash
cd ../
python src/.test-unit.py" > test/PyTorchGuiTest
chmod 755 test/PyTorchGuiTest
if [ $? -eq 0 ]; then
echo test/PyTorchGuiTest generate: OK
echo
else
echo test/PyTorchGuiTest generate: FAILLED
echo
fi