Merge pull request #960 from jmorganca/mxyng/fix-tautology

This commit is contained in:
Michael Yang 2023-11-01 08:30:49 -07:00 committed by GitHub
commit ec3614812a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,16 +102,14 @@ func RunHandler(cmd *cobra.Command, args []string) error {
name := args[0]
// check if the model exists on the server
_, err = client.Show(context.Background(), &api.ShowRequest{Name: name})
if err != nil {
var statusError api.StatusError
switch {
case errors.As(err, &statusError) && statusError.StatusCode == http.StatusNotFound:
if err := PullHandler(cmd, args); err != nil {
return err
}
case err != nil:
var statusError api.StatusError
switch {
case errors.As(err, &statusError) && statusError.StatusCode == http.StatusNotFound:
if err := PullHandler(cmd, args); err != nil {
return err
}
case err != nil:
return err
}
return RunGenerate(cmd, args)