From 19c04f1482ffa5093d9a6d497213e7d3fae06b7f Mon Sep 17 00:00:00 2001 From: Froxcey Date: Mon, 25 Mar 2024 15:27:05 +0800 Subject: [PATCH] Cli: Add zig compiler color The compiler doesn't pass color to the parent process unless it is called with `--colour on`. This commit adds those arguments to add support for coloring in compiler outputs. --- cli/commands/bundle.zig | 2 +- cli/commands/server.zig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/commands/bundle.zig b/cli/commands/bundle.zig index b452f55..d9972a5 100644 --- a/cli/commands/bundle.zig +++ b/cli/commands/bundle.zig @@ -62,7 +62,7 @@ pub fn run( var install_argv = std.ArrayList([]const u8).init(allocator); defer install_argv.deinit(); - try install_argv.appendSlice(&[_][]const u8{ "zig", "build" }); + try install_argv.appendSlice(&[_][]const u8{ "zig", "build", "--color", "on" }); switch (builtin.os.tag) { .windows => try tar_argv.appendSlice(&[_][]const u8{ diff --git a/cli/commands/server.zig b/cli/commands/server.zig index b8d4b42..b257a33 100644 --- a/cli/commands/server.zig +++ b/cli/commands/server.zig @@ -63,10 +63,11 @@ pub fn run( ); while (true) { + // TODO: Catch this error instead of propagating try util.runCommand( allocator, realpath, - &[_][]const u8{ "zig", "build", "-Djetzig_runner=true", "install" }, + &[_][]const u8{ "zig", "build", "-Djetzig_runner=true", "install", "--color", "on" }, ); const exe_path = try util.locateExecutable(allocator, cwd, .{});