avoid printing the summary in certain cases

This commit is contained in:
Evan Wallace
2021-03-06 20:06:41 -08:00
parent 81f5d6c412
commit 8201426cd0
2 changed files with 6 additions and 4 deletions

View File

@@ -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 := "⚡ "
@@ -753,7 +754,7 @@ 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(),
@@ -761,7 +762,6 @@ func PrintSummary(useColor UseColor, table SummaryTable, start *time.Time) {
))
}
sb.WriteByte('\n')
return sb.String()
})
}

View File

@@ -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)
}