Skip to content

Commit

Permalink
fix: resolved database startup script not checking docker daemon status
Browse files Browse the repository at this point in the history
  • Loading branch information
0pilatos0 authored Oct 3, 2024
1 parent 33d9574 commit 78cb06f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-elephants-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": patch
---

Resolved issue where database startup script did not check for docker daemon being up and running
5 changes: 5 additions & 0 deletions cli/template/extras/start-database/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if ! [ -x "$(command -v docker)" ]; then
exit 1
fi

if ! docker info > /dev/null 2>&1; then
echo "Docker daemon is not running. Please start Docker and try again."
exit 1
fi

if [ "$(docker ps -q -f name=$DB_CONTAINER_NAME)" ]; then
echo "Database container '$DB_CONTAINER_NAME' already running"
exit 0
Expand Down
5 changes: 5 additions & 0 deletions cli/template/extras/start-database/postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ if ! [ -x "$(command -v docker)" ]; then
exit 1
fi

if ! docker info > /dev/null 2>&1; then
echo "Docker daemon is not running. Please start Docker and try again."
exit 1
fi

if [ "$(docker ps -q -f name=$DB_CONTAINER_NAME)" ]; then
echo "Database container '$DB_CONTAINER_NAME' already running"
exit 0
Expand Down

0 comments on commit 78cb06f

Please sign in to comment.