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
b58d5d16
Commit
b58d5d16
authored
Sep 19, 2023
by
Michael Yang
Browse files
fix mkdir on windows
parent
24580df9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
cmd/cmd.go
cmd/cmd.go
+1
-1
server/auth.go
server/auth.go
+2
-2
server/download.go
server/download.go
+2
-2
server/images.go
server/images.go
+2
-2
No files found.
cmd/cmd.go
View file @
b58d5d16
...
@@ -722,7 +722,7 @@ func initializeKeypair() error {
...
@@ -722,7 +722,7 @@ func initializeKeypair() error {
return
err
return
err
}
}
err
=
os
.
MkdirAll
(
path
.
Dir
(
privKeyPath
),
0
o7
00
)
err
=
os
.
MkdirAll
(
file
path
.
Dir
(
privKeyPath
),
0
o7
55
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"could not create directory %w"
,
err
)
return
fmt
.
Errorf
(
"could not create directory %w"
,
err
)
}
}
...
...
server/auth.go
View file @
b58d5d16
...
@@ -14,7 +14,7 @@ import (
...
@@ -14,7 +14,7 @@ import (
"net/http"
"net/http"
"net/url"
"net/url"
"os"
"os"
"path"
"path
/filepath
"
"strconv"
"strconv"
"strings"
"strings"
"time"
"time"
...
@@ -82,7 +82,7 @@ func getAuthToken(ctx context.Context, redirData AuthRedirect) (string, error) {
...
@@ -82,7 +82,7 @@ func getAuthToken(ctx context.Context, redirData AuthRedirect) (string, error) {
return
""
,
err
return
""
,
err
}
}
keyPath
:=
path
.
Join
(
home
,
".ollama"
,
"id_ed25519"
)
keyPath
:=
file
path
.
Join
(
home
,
".ollama"
,
"id_ed25519"
)
rawKey
,
err
:=
os
.
ReadFile
(
keyPath
)
rawKey
,
err
:=
os
.
ReadFile
(
keyPath
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
server/download.go
View file @
b58d5d16
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
"log"
"log"
"net/http"
"net/http"
"os"
"os"
"path"
"path
/filepath
"
"strconv"
"strconv"
"sync"
"sync"
"time"
"time"
...
@@ -173,7 +173,7 @@ func doDownload(ctx context.Context, opts downloadOpts, f *FileDownload) error {
...
@@ -173,7 +173,7 @@ func doDownload(ctx context.Context, opts downloadOpts, f *FileDownload) error {
return
fmt
.
Errorf
(
"%w: on download registry responded with code %d: %v"
,
errDownload
,
resp
.
StatusCode
,
string
(
body
))
return
fmt
.
Errorf
(
"%w: on download registry responded with code %d: %v"
,
errDownload
,
resp
.
StatusCode
,
string
(
body
))
}
}
err
=
os
.
MkdirAll
(
path
.
Dir
(
f
.
FilePath
),
0
o700
)
err
=
os
.
MkdirAll
(
file
path
.
Dir
(
f
.
FilePath
),
0
o700
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"make blobs directory: %w"
,
err
)
return
fmt
.
Errorf
(
"make blobs directory: %w"
,
err
)
}
}
...
...
server/images.go
View file @
b58d5d16
...
@@ -1161,8 +1161,8 @@ func PushModel(ctx context.Context, name string, regOpts *RegistryOptions, fn fu
...
@@ -1161,8 +1161,8 @@ func PushModel(ctx context.Context, name string, regOpts *RegistryOptions, fn fu
return
err
return
err
}
}
if
strings
.
HasPrefix
(
path
.
Base
(
location
.
Path
),
"sha256:"
)
{
if
strings
.
HasPrefix
(
file
path
.
Base
(
location
.
Path
),
"sha256:"
)
{
layer
.
Digest
=
path
.
Base
(
location
.
Path
)
layer
.
Digest
=
file
path
.
Base
(
location
.
Path
)
fn
(
api
.
ProgressResponse
{
fn
(
api
.
ProgressResponse
{
Status
:
"using existing layer"
,
Status
:
"using existing layer"
,
Digest
:
layer
.
Digest
,
Digest
:
layer
.
Digest
,
...
...
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