forked from nikzagarwal/Project_21
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication-install-ubuntu.sh
More file actions
executable file
·31 lines (24 loc) · 1.01 KB
/
Copy pathapplication-install-ubuntu.sh
File metadata and controls
executable file
·31 lines (24 loc) · 1.01 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
#!/bin/sh
#The below function will be called in case Ctrl+C is pressed, i.e, Interrupt
terminationFunction () {
trap INT #Restore signal handling to previous before exit.
echo ''
echo 'Exiting... Deleting folders created...' # Printing Message
rm -rf env #Deleting the environment if Interrupt is encountered
echo 'Deletion Successful. Exited.'
exit #To exit the script
}
# Set up SIGINT trap to call terminationFunction.
trap "terminationFunction" INT
echo 'Project21 Setting up Python Virtual Environment...'
python3 -m venv venv
echo 'Project21 Python Virtual Environment Created...'
#To Activate the Virtual Environment
. venv/bin/activate
#install requirements
echo 'Installing Requirements in the virtual environment... This may take a while... (15-20 mins) Please be patient...'
pip3 install -r requirements.txt
echo 'All requirements installed successfully...'
deactivate
# Restore signal handling to previous before exit.
trap INT