Skip to content

Commit 9d6b154

Browse files
samrosesoedirgo
authored andcommitted
chore: do nothing if not running
1 parent c7c30de commit 9d6b154

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nix/tools/dbmate-tool.sh.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ cleanup() {
3232
echo "Stopping PostgreSQL gracefully..."
3333
pkill -f "postgres" || true # Adjust this if you have a specific way to stop the service
3434
sleep 5 # Wait for PostgreSQL to shut down
35+
else
36+
echo "PostgreSQL is not running, skipping stop."
3537
fi
3638

3739
# Verify cleanup
3840
if pgrep -f "postgres" >/dev/null; then
3941
echo "Warning: Some PostgreSQL processes could not be cleaned up:"
4042
pgrep -f "postgres"
41-
return 1
43+
exit 1 # Exit with an error code
4244
else
4345
echo "Cleanup completed successfully"
4446
fi

0 commit comments

Comments
 (0)