diff --git a/internal/runners/commit/commit.go b/internal/runners/commit/commit.go index 08a7f2f12b..cdf503db46 100644 --- a/internal/runners/commit/commit.go +++ b/internal/runners/commit/commit.go @@ -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 @@ -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(