refactor: polish CLI theme + progress helpers
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { existsSync } from "node:fs";
|
||||
import chalk from "chalk";
|
||||
import { promptYesNo } from "../cli/prompt.js";
|
||||
import {
|
||||
danger,
|
||||
@@ -8,6 +7,7 @@ import {
|
||||
shouldLogVerbose,
|
||||
warn,
|
||||
} from "../globals.js";
|
||||
import { colorize, isRich, theme } from "../terminal/theme.js";
|
||||
import { runExec } from "../process/exec.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
|
||||
import { ensureBinary } from "./binaries.js";
|
||||
@@ -180,8 +180,17 @@ export async function ensureFunnel(
|
||||
),
|
||||
);
|
||||
if (shouldLogVerbose()) {
|
||||
if (stdout.trim()) runtime.error(chalk.gray(`stdout: ${stdout.trim()}`));
|
||||
if (stderr.trim()) runtime.error(chalk.gray(`stderr: ${stderr.trim()}`));
|
||||
const rich = isRich();
|
||||
if (stdout.trim()) {
|
||||
runtime.error(
|
||||
colorize(rich, theme.muted, `stdout: ${stdout.trim()}`),
|
||||
);
|
||||
}
|
||||
if (stderr.trim()) {
|
||||
runtime.error(
|
||||
colorize(rich, theme.muted, `stderr: ${stderr.trim()}`),
|
||||
);
|
||||
}
|
||||
runtime.error(err as Error);
|
||||
}
|
||||
runtime.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user