Skip to content

Commit

Permalink
Check if final tag exists before trying to find latest rc tag
Browse files Browse the repository at this point in the history
This fixes the issue #526
  • Loading branch information
m-gorecki authored and sjanc committed Oct 26, 2023
1 parent 24e6a29 commit 7dfe546
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions newt/cli/project_cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,20 @@ func newRunCmd(cmd *cobra.Command, args []string) {
NewtUsage(nil, err)
}

commit, err := dl.LatestRc(tmpdir, newtutil.NewtBlinkyTag)
if err != nil {
NewtUsage(nil, err)
}

commit := newtutil.NewtBlinkyTag
err = dl.Checkout(tmpdir, commit)

/* If checkout with final tag fails, try to find latest rc tag */
if err != nil {
NewtUsage(nil, err)
commit, err = dl.LatestRc(tmpdir, newtutil.NewtBlinkyTag)
if err != nil {
NewtUsage(nil, err)
}

err = dl.Checkout(tmpdir, commit)
if err != nil {
NewtUsage(nil, err)
}
}

util.StatusMessage(util.VERBOSITY_DEFAULT, "Installing "+
Expand Down

0 comments on commit 7dfe546

Please sign in to comment.