Skip to content

Commit

Permalink
Fix crash with targets show
Browse files Browse the repository at this point in the history
`fioctl targets show ""` causes the tool to crash. This helps it fail
more cleanly.

Signed-off-by: Andy Doan <andy@foundries.io>
  • Loading branch information
doanac committed Oct 6, 2023
1 parent ba783a0 commit 195329f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions subcommands/targets/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package targets
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -210,6 +211,10 @@ func doShowComposeApp(cmd *cobra.Command, args []string) {
}

func getTargets(factory string, prodTag string, version string) ([]string, map[string]string, map[string]client.TufCustom) {
if len(version) == 0 {
subcommands.DieNotNil(errors.New("Missing required argument <version>"))
}

var targets tuf.Files
var prodMeta *client.AtsTufTargets

Expand Down

0 comments on commit 195329f

Please sign in to comment.