Skip to content

Commit

Permalink
avoid printing the summary in certain cases
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Mar 7, 2021
1 parent 28a3e0b commit c7039dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ func PrintSummary(useColor UseColor, table SummaryTable, start *time.Time) {
sb.WriteString(fmt.Sprintf("%s%s...and %d more output file%s...%s\n", margin, colors.Dim, length-maxLength, plural, colors.Default))
}
}
sb.WriteByte('\n')

lightningSymbol := "⚡ "

Expand All @@ -753,15 +754,14 @@ func PrintSummary(useColor UseColor, table SummaryTable, start *time.Time) {

// Printing the time taken is optional
if start != nil {
sb.WriteString(fmt.Sprintf("\n%s%sDone in %dms%s\n",
sb.WriteString(fmt.Sprintf("%s%sDone in %dms%s\n",
lightningSymbol,
colors.Green,
time.Since(*start).Milliseconds(),
colors.Default,
))
}

sb.WriteByte('\n')
return sb.String()
})
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/api/api_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,10 @@ func buildImpl(buildOpts BuildOptions) internalBuildResult {
plugins := loadPlugins(realFS, log, buildOpts.Plugins)
internalResult := rebuildImpl(buildOpts, cache.MakeCacheSet(), plugins, logOptions, log, false /* isRebuild */)

// Print a summary to stderr
if logOptions.LogLevel <= logger.LevelInfo && buildOpts.Watch == nil && !buildOpts.Incremental {
// Print a summary of the generated files to stderr. Except don't do
// this if the terminal is already being used for something else.
if logOptions.LogLevel <= logger.LevelInfo && len(internalResult.result.OutputFiles) > 0 &&
buildOpts.Watch == nil && !buildOpts.Incremental && !internalResult.options.WriteToStdout {
printSummary(logOptions, internalResult.result.OutputFiles, start)
}

Expand Down

0 comments on commit c7039dc

Please sign in to comment.