Skip to content

Commit efc8a75

Browse files
committed
Filter on exact container name
1 parent 264b272 commit efc8a75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tasks/reset.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set -euo pipefail
88

99
fail_if_postgres_not_running () {
10-
containers=$(docker ps --filter "name=${container_name}" --quiet)
10+
containers=$(docker ps --filter "name=^${container_name}$" --quiet)
1111
if [ -z "${containers}" ]; then
1212
echo "error: Docker container for PostgreSQL is not running"
1313
echo "error: Try running 'mise run postgres:up ${container_name}' to start the container"

tasks/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ connection_url=postgresql://${POSTGRES_USER:-$USER}:${POSTGRES_PASSWORD}@${POSTG
1414
container_name=postgres-${POSTGRES_VERSION}
1515

1616
fail_if_postgres_not_running () {
17-
containers=$(docker ps --filter "name=${container_name}" --quiet)
17+
containers=$(docker ps --filter "name=^${container_name}$" --quiet)
1818
if [ -z "${containers}" ]; then
1919
echo "error: Docker container for PostgreSQL is not running"
2020
echo "error: Try running 'mise run postgres:up ${container_name}' to start the container"

0 commit comments

Comments
 (0)