Skip to content

Commit

Permalink
Ensure output format is supported at artifact_get.go (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimitrov authored Dec 20, 2023
1 parent eacc684 commit 969ec04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/cli/app/artifact/artifact_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func getCommand(ctx context.Context, cmd *cobra.Command, conn *grpc.ClientConn)
return cli.MessageAndError(fmt.Sprintf("Provider %s is not supported yet", provider), fmt.Errorf("invalid argument"))
}

// Ensure the output format is supported
if !app.IsOutputFormatSupported(format) {
return cli.MessageAndError(fmt.Sprintf("Output format %s not supported", format), fmt.Errorf("invalid argument"))
}

// check artifact by name
art, err := client.GetArtifactById(ctx, &minderv1.GetArtifactByIdRequest{
Context: &minderv1.Context{Provider: &provider, Project: &project},
Expand Down

0 comments on commit 969ec04

Please sign in to comment.