Skip to content

Commit b79e851

Browse files
committed
Fix bin/docker-stats not working properly #1075
1 parent 85c0494 commit b79e851

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compose/bin/docker-stats

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22

3-
container_ids=$(bin/docker-compose ps -q)
3+
IFS=$'\n' read -d '' -r -a container_ids < <(bin/docker-compose ps -q)
44

5-
if [ -z "$container_ids" ]; then
5+
if [ ${#container_ids[@]} -eq 0 ]; then
66
echo "No active containers found"
77
exit 1
88
fi
99

10-
docker stats "$container_ids"
10+
docker stats "${container_ids[@]}"

0 commit comments

Comments
 (0)