Debian Codegraph @

.github/workflows/scripts/wait_docker_mac.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2
3 # refs:
4 # https://stackoverflow.com/a/35979292/425458
5
6 [[ $(uname) == 'Darwin' ]] || { echo "This function only runs on macOS." >&2; exit 2; }
7
8 echo "-- Starting Docker.app, if necessary..."
9
10 open -g -a Docker.app || exit
11
12 # Wait for the server to start up, if applicable.
13 i=0
14 while ! docker system info &>/dev/null; do
15 (( i++ == 0 )) && printf %s '-- Waiting for Docker to finish starting up...' || printf '.'
16 sleep 1
17 done
18 (( i )) && printf '\n'
19
20 echo "-- Docker is ready."