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
e9216ea4
Commit
e9216ea4
authored
Nov 26, 2023
by
Jeffrey Morgan
Browse files
fix readline history on linux
parent
9e4a3164
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
readline/history.go
readline/history.go
+4
-1
No files found.
readline/history.go
View file @
e9216ea4
...
@@ -43,9 +43,12 @@ func (h *History) Init() error {
...
@@ -43,9 +43,12 @@ func (h *History) Init() error {
}
}
path
:=
filepath
.
Join
(
home
,
".ollama"
,
"history"
)
path
:=
filepath
.
Join
(
home
,
".ollama"
,
"history"
)
if
err
:=
os
.
MkdirAll
(
filepath
.
Dir
(
path
),
0
o755
);
err
!=
nil
{
return
err
}
h
.
Filename
=
path
h
.
Filename
=
path
//todo check if the file exists
f
,
err
:=
os
.
OpenFile
(
path
,
os
.
O_CREATE
|
os
.
O_RDONLY
,
0600
)
f
,
err
:=
os
.
OpenFile
(
path
,
os
.
O_CREATE
|
os
.
O_RDONLY
,
0600
)
if
err
!=
nil
{
if
err
!=
nil
{
if
errors
.
Is
(
err
,
os
.
ErrNotExist
)
{
if
errors
.
Is
(
err
,
os
.
ErrNotExist
)
{
...
...
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