Skip to content

Commit

Permalink
Merge pull request #3587 from ActiveState/mitchell/dx-3154
Browse files Browse the repository at this point in the history
Declining the security prompt should cancel `state commit`.
  • Loading branch information
mitchell-as authored Nov 8, 2024
2 parents d0c984f + be89fa8 commit f8618f6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions internal/runners/commit/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,6 @@ func (c *Commit) Run() (rerr error) {
return errs.Wrap(err, "Could not update project to reflect build script changes.")
}

// Update local commit ID
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
return errs.Wrap(err, "Could not set local commit ID")
}

// Update our local build expression to match the committed one. This allows our API a way to ensure forward compatibility.
newScript, err := bp.GetBuildScript(stagedCommit.CommitID.String())
if err != nil {
return errs.Wrap(err, "Unable to get the remote build script")
}
if err := buildscript_runbit.Update(proj, newScript); err != nil {
return errs.Wrap(err, "Could not update local build script")
}

pg.Stop(locale.T("progress_success"))
pg = nil

Expand Down Expand Up @@ -169,6 +155,20 @@ func (c *Commit) Run() (rerr error) {
return errs.Wrap(err, "Could not report CVEs")
}

// Update local commit ID
if err := localcommit.Set(proj.Dir(), stagedCommit.CommitID.String()); err != nil {
return errs.Wrap(err, "Could not set local commit ID")
}

// Update our local build expression to match the committed one. This allows our API a way to ensure forward compatibility.
newScript, err := bp.GetBuildScript(stagedCommit.CommitID.String())
if err != nil {
return errs.Wrap(err, "Unable to get the remote build script")
}
if err := buildscript_runbit.Update(proj, newScript); err != nil {
return errs.Wrap(err, "Could not update local build script")
}

out.Notice("") // blank line
out.Print(output.Prepare(
locale.Tl(
Expand Down

0 comments on commit f8618f6

Please sign in to comment.