Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ jobs:
npm --version
cloc --version
act --version
ollama --version
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The following tools are installed (or skipped if already present):
| [Node.js + npm](https://nodejs.org) | `brew install node` |
| [`cloc`](https://github.com/AlDanial/cloc) | `brew install cloc` |
| [`act`](https://github.com/nektos/act) | `brew install act` |
| [Ollama](https://ollama.com) | `curl -fsSL https://ollama.com/install.sh | sh` |

The script is **idempotent** — re-running it is safe and will skip anything already installed.

Expand Down
8 changes: 8 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ else
echo "🎬 act is already running scenes on the Severed Floor."
fi

# 14. Ollama — local models for the Severed Floor
if ! command -v ollama &>/dev/null; then
echo "🦙 Ollama not found. The work needs a local model stack. Installing..."
brew install ollama
else
echo "🦙 Ollama is already running on the Severed Floor."
fi

echo ""
echo "✅ Macrodata Refinement environment initialised."
echo " The work is mysterious and important. Praise Kier. 🫱"
32 changes: 31 additions & 1 deletion test/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ EOF
exit 0
EOF
chmod +x "$MOCK_BIN/curl"

# sh mock: Ollama's install script pipes curl output into sh.
cat > "$MOCK_BIN/sh" <<'EOF'
#!/bin/bash
exit 0
EOF
chmod +x "$MOCK_BIN/sh"
}

teardown() {
Expand Down Expand Up @@ -362,6 +369,28 @@ EOF
[[ "$output" == *"act is already running scenes"* ]]
}

# ---------------------------------------------------------------------------
# Ollama section
# ---------------------------------------------------------------------------

@test "installs Ollama when ollama is not on PATH" {
run env PATH="$MOCK_BIN" /bin/bash "$SCRIPT"
[ "$status" -eq 0 ]
[[ "$output" == *"Ollama not found"* ]]
}

@test "skips Ollama when ollama is already installed" {
cat > "$MOCK_BIN/ollama" <<'EOF'
#!/bin/bash
exit 0
EOF
chmod +x "$MOCK_BIN/ollama"

run bash "$SCRIPT"
[ "$status" -eq 0 ]
[[ "$output" == *"Ollama is already running"* ]]
}

# ---------------------------------------------------------------------------
# End-to-end: all tools already present
# ---------------------------------------------------------------------------
Expand All @@ -374,7 +403,7 @@ EOF

@test "exits successfully when all tools are already installed" {
# Stubs for every command-based tool
for tool in gcloud oc gh uvx python3 gws node cloc act; do
for tool in gcloud oc gh uvx python3 gws node cloc act ollama; do
cat > "$MOCK_BIN/$tool" <<'EOF'
#!/bin/bash
exit 0
Expand Down Expand Up @@ -404,4 +433,5 @@ EOF
[[ "$output" == *"Defiant Jazz"* ]]
[[ "$output" == *"cloc is already tallying lines"* ]]
[[ "$output" == *"act is already running scenes"* ]]
[[ "$output" == *"Ollama is already running"* ]]
}
Loading