forked from kingan1/application-tracking-system
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
30 lines (28 loc) · 910 Bytes
/
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
#! /bin/bash
# This setup file assumes you have pip and npm already installed, and that
# you are using this script from an already-cloned repository in the project root directory.
# Quick success/failure color function. Nothing particularly groundbreaking here
# $1 = exit code
# $2 = task attempted
exit_result () {
if [[ $1 -eq 0 ]]
then
echo -e "\033[0;32m$2: Success\033[0m"
else
echo -e "\033[0;31m$2: Failure\033[0m"
exit 1
fi
}
echo -e "Navigating to frontend directory..."
cd ./frontend || exit
echo -e "Attempting to install NPM packages..."
npm install
exit_result $? "NPM package installation"
echo -e "Verifying pip installation..."
pip -V
exit_result $? "pip installation check"
echo -e "Returning to project root directory"
cd ../ || exit
echo -e "Installing required pip packages from requirements.txt..."
pip install -r ./requirements.txt
exit_result $? "pip package installation"