Skip to content

Commit 47c8676

Browse files
authored
fix: ollama.ts lint and typecheck issues (#2538)
1 parent 5cb1cb7 commit 47c8676

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/ollama.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
const ListModelGenerator: Fig.Generator = {
22
script: ["bash", "-c", "ollama ls | awk '!/NAME/ { print $1 }'"],
3-
postProcess: (out) => out.trim().split("\n"),
3+
postProcess: (out) => {
4+
return out
5+
.trim()
6+
.split("\n")
7+
.map((model) => ({ name: model }));
8+
},
49
};
510

611
const RunModelGenerator: Fig.Generator = {
712
script: ["bash", "-c", "ollama ps | awk '!/NAME/ { print $1 }'"],
8-
postProcess: (out) => out.trim().split("\n"),
13+
postProcess: (out) => {
14+
return out
15+
.trim()
16+
.split("\n")
17+
.map((model) => ({ name: model }));
18+
},
919
};
1020

1121
const completionSpec: Fig.Spec = {
@@ -81,9 +91,9 @@ const completionSpec: Fig.Spec = {
8191
name: "cp",
8292
description: "Copy a model",
8393
args: {
84-
name: "SOURCE",
85-
generators: ListModelGenerator,
86-
},
94+
name: "SOURCE",
95+
generators: ListModelGenerator,
96+
},
8797
},
8898
{
8999
name: "rm",

0 commit comments

Comments
 (0)