install: wait for server to be ready after starting on macOS

This commit is contained in:
Bruce MacDonald
2026-03-24 15:33:31 -07:00
parent c9b5da6b0c
commit e4c48e80f5

View File

@@ -86,6 +86,12 @@ if [ "$OS" = "Darwin" ]; then
if [ -z "${OLLAMA_NO_START:-}" ]; then
status "Starting Ollama..."
open -a Ollama --args hidden
# Wait for the server to be ready
for i in 1 2 3 4 5; do
curl -s http://localhost:11434/ >/dev/null 2>&1 && break
sleep 1
done
fi
status "Install complete. You can now run 'ollama'."