From 3f767e8e4021f57224823f0a1af98b81687b1891 Mon Sep 17 00:00:00 2001 From: Jocadbz Date: Tue, 4 Nov 2025 22:30:04 -0300 Subject: [PATCH] Refactor color constants and update should_use_color function for consistency --- builder/builder.v | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/builder/builder.v b/builder/builder.v index 72a9bb2..e415c15 100644 --- a/builder/builder.v +++ b/builder/builder.v @@ -37,16 +37,14 @@ struct CompileResult { err string } -const ( - ansi_reset = '\x1b[0m' - ansi_red = '\x1b[31m' - ansi_green = '\x1b[32m' - ansi_yellow = '\x1b[33m' - ansi_cyan = '\x1b[36m' -) +const ansi_reset = '\x1b[0m' +const ansi_red = '\x1b[31m' +const ansi_green = '\x1b[32m' +const ansi_yellow = '\x1b[33m' +const ansi_cyan = '\x1b[36m' fn should_use_color() bool { - return os.getenv('NO_COLOR') == '' && os.isatty(1) + return os.getenv('NO_COLOR') == '' && os.is_atty(1) != 0 } fn colorize(text string, color string) string { @@ -209,7 +207,7 @@ fn build_from_directives(mut build_config config.BuildConfig, mut shared_libs_bu } // Topological sort to determine build order - for unit_name, directive in dep_graph { + for unit_name, _ in dep_graph { if unit_name in built_units { continue }