make fancy logger dumb in ci

This commit is contained in:
Jacky Zhao
2025-03-16 14:12:43 -07:00
parent 40a72eba44
commit 1bb6f09db1
4 changed files with 20 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ import { Mutex } from "async-mutex"
import { getStaticResourcesFromPlugins } from "./plugins"
import { randomIdNonSecure } from "./util/random"
import { ChangeEvent } from "./plugins/types"
import { minimatch } from "minimatch"
type ContentMap = Map<
FilePath,
@@ -117,11 +118,23 @@ async function startWatching(
})
}
const gitIgnoredMatcher = await isGitIgnored()
const buildData: BuildData = {
ctx,
mut,
contentMap,
ignored: await isGitIgnored(),
ignored: (path) => {
if (gitIgnoredMatcher(path)) return true
const pathStr = path.toString()
for (const pattern of cfg.configuration.ignorePatterns) {
if (minimatch(pathStr, pattern)) {
return true
}
}
return false
},
changesSinceLastBuild: {},
lastBuildMs: 0,
}

View File

@@ -10,7 +10,9 @@ export class QuartzLogger {
private readonly spinnerChars = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
constructor(verbose: boolean) {
this.verbose = verbose
const isInteractiveTerminal =
process.stdout.isTTY && process.env.TERM !== "dumb" && !process.env.CI
this.verbose = verbose || !isInteractiveTerminal
}
start(text: string) {