Compare commits
1 Commits
bmizerany/
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
67691e410d |
@ -800,9 +800,9 @@ func ShowHandler(cmd *cobra.Command, args []string) error {
|
||||
case "parameters":
|
||||
fmt.Println(resp.Parameters)
|
||||
case "system":
|
||||
fmt.Println(resp.System)
|
||||
fmt.Print(resp.System)
|
||||
case "template":
|
||||
fmt.Println(resp.Template)
|
||||
fmt.Print(resp.Template)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -540,6 +540,11 @@ func (s *Server) PullHandler(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := checkNameExists(name); err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
|
||||
ch := make(chan any)
|
||||
go func() {
|
||||
defer close(ch)
|
||||
@ -623,7 +628,7 @@ func checkNameExists(name model.Name) error {
|
||||
}
|
||||
|
||||
for n := range names {
|
||||
if strings.EqualFold(n.Filepath(), name.Filepath()) && n.EqualFold(name) {
|
||||
if strings.EqualFold(n.Filepath(), name.Filepath()) && n != name {
|
||||
return errors.New("a model with that name already exists")
|
||||
}
|
||||
}
|
||||
|
@ -298,13 +298,6 @@ func (n Name) LogValue() slog.Value {
|
||||
return slog.StringValue(n.String())
|
||||
}
|
||||
|
||||
func (n Name) EqualFold(o Name) bool {
|
||||
return strings.EqualFold(n.Host, o.Host) &&
|
||||
strings.EqualFold(n.Namespace, o.Namespace) &&
|
||||
strings.EqualFold(n.Model, o.Model) &&
|
||||
strings.EqualFold(n.Tag, o.Tag)
|
||||
}
|
||||
|
||||
func isValidLen(kind partKind, s string) bool {
|
||||
switch kind {
|
||||
case kindHost:
|
||||
|
Loading…
x
Reference in New Issue
Block a user