fix: Line gets erased due to updateJob (#4740)

The first updateJob should be called after the first printStage to
guarantee that only stage prints can get erased and overwritten,
otherwise there could be an unrelated line that gets erased.

fixes #3967
This commit is contained in:
sonnysasaka
2022-10-25 10:27:44 -05:00
committed by GitHub
parent df89e2c3b0
commit 7d831e31c6
+1 -1
View File
@@ -103,7 +103,6 @@ func ProvisionerJob(ctx context.Context, writer io.Writer, opts ProvisionerJobOp
}
updateStage("Running", *job.StartedAt)
}
updateJob()
if opts.Cancel != nil {
// Handles ctrl+c to cancel a job.
@@ -131,6 +130,7 @@ func ProvisionerJob(ctx context.Context, writer io.Writer, opts ProvisionerJobOp
// The initial stage needs to print after the signal handler has been registered.
printStage()
updateJob()
logs, closer, err := opts.Logs()
if err != nil {