skip post-processors when build is cancelled

This commit is contained in:
sylviamoss 2020-08-06 14:40:02 +02:00
parent 09852b89a7
commit 6d0b5a6957
1 changed files with 7 additions and 0 deletions

View File

@ -305,6 +305,13 @@ func (b *CoreBuild) Run(ctx context.Context, originalUi Ui) ([]Artifact, error)
errors := make([]error, 0)
keepOriginalArtifact := len(b.PostProcessors) == 0
select {
case <-ctx.Done():
log.Println("Build was cancelled. Skipping post-processors.")
return nil, nil
default:
}
// Run the post-processors
PostProcessorRunSeqLoop:
for _, ppSeq := range b.PostProcessors {