Skip to content

Commit

Permalink
Fix binary detection
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 29, 2024
1 parent de7a206 commit bedc557
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-olives-appear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"languine": patch
---

ollama binary detection
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@ai-sdk/openai": "^1.0.11",
"@babel/parser": "^7.26.3",
"@clack/prompts": "^0.9.0",
"@types/which": "^3.0.4",
"ai": "^4.0.22",
"chalk": "^5.4.1",
"dedent": "^1.5.3",
Expand All @@ -37,6 +38,7 @@
"preferred-pm": "^4.0.0",
"simple-git": "^3.27.0",
"sucrase": "^3.35.0",
"which": "^5.0.0",
"xml2js": "^0.6.2",
"yaml": "^2.6.1",
"zod": "^3.24.1"
Expand Down
7 changes: 2 additions & 5 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fs from "node:fs/promises";
import path from "node:path";
import { intro, outro, select, text } from "@clack/prompts";
import chalk from "chalk";
import which from "which";
import { installDependencies } from "../install.js";
import { providers } from "../providers.js";
import type { PresetOptions, Provider } from "../types.js";
Expand Down Expand Up @@ -171,11 +172,7 @@ export async function init(preset?: string) {

if (provider === "ollama") {
try {
const ollamaBinary = execSync("which ollama").toString().trim();
if (!ollamaBinary) {
outro("Ollama binary not found. Please install Ollama");
process.exit(1);
}
await which("ollama");
} catch (error) {
outro("Ollama binary not found. Please install Ollama");
process.exit(1);
Expand Down

0 comments on commit bedc557

Please sign in to comment.