File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ docker -v > /dev/null 2>&1
38
38
DOCKER_EXISTS=$?
39
39
if [ " $DOCKER_EXISTS " -ne 0 ]; then
40
40
printf " \n\n${CYAN} Status: ${PLAIN}${RED} Docker not found. Terminating setup.${PLAIN} \n\n"
41
- exit 1
41
+ return 1
42
42
fi
43
43
printf " \n${CYAN} Found docker. Moving on with the setup.${PLAIN} \n"
44
44
@@ -57,7 +57,7 @@ printf "\n${RED}>> Starting the postgresql container${PLAIN} ${GREEN}...${PLAIN}
57
57
CONTAINER_STATUS=$( docker run --name $POSTGRESQL_CONTAINER -e POSTGRES_USER=$USER -e POSTGRES_PASSWORD=$PASSWORD -p $PORT :5432 -d postgres:latest 2>&1 )
58
58
if [[ " $CONTAINER_STATUS " == * " Error" * ]]; then
59
59
printf " \n\n${CYAN} Status: ${PLAIN}${RED} Error starting container. Terminating setup.${PLAIN} \n\n"
60
- exit 1
60
+ return 1
61
61
fi
62
62
docker cp ./test/schema.sql $POSTGRESQL_CONTAINER :/home/ > /dev/null 2>&1
63
63
printf " \n${CYAN} Container is up and running.${PLAIN} \n"
@@ -91,7 +91,7 @@ while [ "$OUTPUT" -ne 0 ] && [ "$TIMEOUT" -gt 0 ]
91
91
92
92
if [ " $TIMEOUT " -le 0 ]; then
93
93
printf " \n\n${CYAN} Status: ${PLAIN}${RED} Failed to export schema. Terminating setup.${PLAIN} \n\n"
94
- exit 1
94
+ return 1
95
95
fi
96
96
printf " \n${CYAN} Successfully exported schema to database.${PLAIN} \n"
97
97
@@ -102,7 +102,7 @@ docker exec -it $POSTGRESQL_CONTAINER /bin/sh -c "psql -U $USER -c 'CREATE DATAB
102
102
CREATE_DATABASE=$?
103
103
if [ " $CREATE_DATABASE " -ne 0 ]; then
104
104
printf " \n\n${CYAN} Status: ${PLAIN}${RED} Error creating database: $DATABASE . Terminating setup.${PLAIN} \n\n"
105
- exit 1
105
+ return 1
106
106
fi
107
107
printf " \n${CYAN} Database created.${PLAIN} \n"
108
108
You can’t perform that action at this time.
0 commit comments