rebase
This commit is contained in:
parent
3a724a7c80
commit
96d0cd92f2
10
cmd/cmd.go
10
cmd/cmd.go
@ -318,6 +318,7 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string, spinner *pr
|
|||||||
|
|
||||||
digest := fmt.Sprintf("sha256:%x", hash.Sum(nil))
|
digest := fmt.Sprintf("sha256:%x", hash.Sum(nil))
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// We check if we can find the models directory locally
|
// We check if we can find the models directory locally
|
||||||
// If we can, we return the path to the directory
|
// If we can, we return the path to the directory
|
||||||
// If we can't, we return an error
|
// If we can't, we return an error
|
||||||
@ -334,6 +335,12 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string, spinner *pr
|
|||||||
// Linux errors out to use io.copy
|
// Linux errors out to use io.copy
|
||||||
err = localCopy(path, dest)
|
err = localCopy(path, dest)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
=======
|
||||||
|
if client.IsLocal() {
|
||||||
|
dest, err := getLocalPath(cmd.Context(), digest)
|
||||||
|
|
||||||
|
if errors.Is(err, ErrBlobExists) {
|
||||||
|
>>>>>>> 7837266d (import local)
|
||||||
return digest, nil
|
return digest, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +351,10 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string, spinner *pr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// If at any point copying the blob over locally fails, we default to the copy through the server
|
// If at any point copying the blob over locally fails, we default to the copy through the server
|
||||||
|
=======
|
||||||
|
>>>>>>> 7837266d (import local)
|
||||||
if err = client.CreateBlob(cmd.Context(), digest, io.TeeReader(bin, &pw)); err != nil {
|
if err = client.CreateBlob(cmd.Context(), digest, io.TeeReader(bin, &pw)); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user