-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
74 lines (52 loc) · 2.07 KB
/
setup.sh
File metadata and controls
74 lines (52 loc) · 2.07 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
echo '
_____ _____
| __ \ / ____|
| |__) |___ _ __ __ _ _ __ | (___ ___ _ ____ _____ _ __ ___
| _ // _ \| '\''_ \ / _` | '\''_ \ \___ \ / _ \ '\''__\ \ / / _ \ '\''__/ __|
| | \ \ (_) | | | | (_| | | | |____) | __/ | \ V / __/ | \__ \
|_| \_\___/|_| |_|\__,_|_| |_|_____/ \___|_| \_/ \___|_| |___/
'
echo "----------------------"
echo "Setting up the project"
echo "----------------------"
echo "Installing Dependencies"
npm install
npm install --save-dev
clear
echo '
_____ _____
| __ \ / ____|
| |__) |___ _ __ __ _ _ __ | (___ ___ _ ____ _____ _ __ ___
| _ // _ \| '\''_ \ / _` | '\''_ \ \___ \ / _ \ '\''__\ \ / / _ \ '\''__/ __|
| | \ \ (_) | | | | (_| | | | |____) | __/ | \ V / __/ | \__ \
|_| \_\___/|_| |_|\__,_|_| |_|_____/ \___|_| \_/ \___|_| |___/
'
if [ -f .env ]; then
echo " ---- "
echo "[Setup] the .env file exists, skipping..."
echo " ---- "
else
echo "Creating .env file"
cp .env.example .env
# Prompt the user for the database connection options
read -p "Enter the hostname or IP address of the database server: " db_host
read -p "Enter the port number that the database server is listening on: " db_port
read -p "Enter the username used to authenticate to the database server: " db_username
read -p "Enter the password used to authenticate to the database server: " db_password
read -p "Enter the name of the database that the project will be using: " db_database
# Write the user's responses to the .env file
echo "DB_HOST=$db_host" > .env
echo "DB_PORT=$db_port" >> .env
echo "DB_USERNAME=$db_username" >> .env
echo "DB_PASSWORD=$db_password" >> .env
echo "DB_DATABASE=$db_database" >> .env
echo " "
echo " "
echo "Set the environment variables."
echo " "
echo " "
fi
read -p "Would you like me to start the server in development mode? [Yes/No] " start_dev
if [ "$start_dev" == "Yes" ]; then
npm run start:dev
fi