Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
5d75d837
Unverified
Commit
5d75d837
authored
Jan 30, 2025
by
Jeffrey Morgan
Committed by
GitHub
Jan 30, 2025
Browse files
discover: fix default LibOllamaPath value (#8702)
parent
711648c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
discover/path.go
discover/path.go
+9
-5
No files found.
discover/path.go
View file @
5d75d837
...
...
@@ -24,12 +24,14 @@ var LibOllamaPath string = func() string {
return
""
}
libPath
:=
filepath
.
Dir
(
exe
)
var
libPath
string
switch
runtime
.
GOOS
{
case
"windows"
:
libPath
=
filepath
.
Join
(
filepath
.
Dir
(
exe
),
"lib"
,
"ollama"
)
case
"linux"
:
libPath
=
filepath
.
Join
(
filepath
.
Dir
(
exe
),
".."
,
"lib"
,
"ollama"
)
case
"darwin"
:
libPath
=
filepath
.
Dir
(
exe
)
}
cwd
,
err
:=
os
.
Getwd
()
...
...
@@ -37,17 +39,19 @@ var LibOllamaPath string = func() string {
return
""
}
// build paths for development
buildPaths
:=
[]
string
{
paths
:=
[]
string
{
libPath
,
// build paths for development
filepath
.
Join
(
filepath
.
Dir
(
exe
),
"build"
,
"lib"
,
"ollama"
),
filepath
.
Join
(
cwd
,
"build"
,
"lib"
,
"ollama"
),
}
for
_
,
p
:=
range
buildP
aths
{
for
_
,
p
:=
range
p
aths
{
if
_
,
err
:=
os
.
Stat
(
p
);
err
==
nil
{
return
p
}
}
return
libPath
return
filepath
.
Dir
(
exe
)
}()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment