Skip to content

Commit 9dbc09f

Browse files
committed
fix 🐛 (colima): validate docker socket (#43)
Signed-off-by: Luis Mayta <luis@hadenlabs.com>
1 parent c9a537c commit 9dbc09f

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

internal/colima.zsh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,11 @@ function container::internal::container::load {
2727
check_command jq || return 1
2828
check_command colima || return 1
2929

30-
local colima_status
31-
if ! colima_status=$(colima status --json 2>/dev/null | jq -r '.status'); then
32-
echo "⚠️ Could not get Colima status. Starting Colima..."
33-
colima start
34-
return
35-
fi
30+
local docker_socket
31+
docker_socket=$(colima status --json 2>/dev/null | jq -r '.docker_socket // empty')
3632

37-
if [[ "$colima_status" != "Running" ]]; then
38-
echo "🚀 Colima is not running. Starting Colima..."
33+
if [[ -z "$docker_socket" ]]; then
34+
echo "🚀 Colima does not seem to be running (docker_socket is empty). Starting Colima..."
3935
colima start
4036
fi
4137
}

0 commit comments

Comments
 (0)