Skip to content

Commit

Permalink
colima setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcwebdev committed Oct 11, 2024
1 parent 6c4bec4 commit 7dd3aa4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"autoshow": "./dist/autoshow.js"
},
"scripts": {
"setup": "bash ./setup.sh",
"setup": "bash ./scripts/setup.sh",
"autoshow": "tsx --env-file=.env --no-warnings src/autoshow.ts",
"as": "tsx --env-file=.env --no-warnings src/autoshow.ts",
"docker": "docker compose run --remove-orphans autoshow",
Expand Down
19 changes: 19 additions & 0 deletions scripts/setup-colima.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Check if Docker is running
if ! docker info &>/dev/null; then
echo "Docker is not running. Checking for Colima..."
if command_exists colima; then
echo "Colima is installed. Attempting to start Colima..."
colima start &>/dev/null
if [ $? -eq 0 ]; then
echo "Colima started successfully."
else
echo "Failed to start Colima. Please start Docker manually or check your Docker installation."
fi
else
echo "Colima is not installed. Please start Docker manually or check your Docker installation."
fi
else
echo "Docker is running."
fi
18 changes: 0 additions & 18 deletions setup.sh → scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,6 @@ else
echo "Ollama is installed."
fi

# Check if Docker is running
if ! docker info &>/dev/null; then
echo "Docker is not running. Checking for Colima..."
if command_exists colima; then
echo "Colima is installed. Attempting to start Colima..."
colima start &>/dev/null
if [ $? -eq 0 ]; then
echo "Colima started successfully."
else
echo "Failed to start Colima. Please start Docker manually or check your Docker installation."
fi
else
echo "Colima is not installed. Please start Docker manually or check your Docker installation."
fi
else
echo "Docker is running."
fi

# Check if Ollama server is running
if ! curl -s "http://127.0.0.1:11434" &> /dev/null; then
echo "Ollama server is not running. Starting Ollama server..."
Expand Down

0 comments on commit 7dd3aa4

Please sign in to comment.