mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 22:33:08 +00:00
rename ZIG_DEBUG_COLOR env variable to YES_COLOR
This commit is contained in:
parent
e05412669c
commit
e45d24c0de
@ -1305,7 +1305,7 @@ fn genHtml(
|
|||||||
defer root_node.end();
|
defer root_node.end();
|
||||||
|
|
||||||
var env_map = try process.getEnvMap(allocator);
|
var env_map = try process.getEnvMap(allocator);
|
||||||
try env_map.put("ZIG_DEBUG_COLOR", "1");
|
try env_map.put("YES_COLOR", "1");
|
||||||
|
|
||||||
const host = try std.zig.system.NativeTargetInfo.detect(.{});
|
const host = try std.zig.system.NativeTargetInfo.detect(.{});
|
||||||
const builtin_code = try getBuiltinCode(allocator, &env_map, zig_exe, opt_zig_lib_dir);
|
const builtin_code = try getBuiltinCode(allocator, &env_map, zig_exe, opt_zig_lib_dir);
|
||||||
|
|||||||
@ -282,7 +282,7 @@ pub fn main() !void {
|
|||||||
const ttyconf = get_tty_conf(color, stderr);
|
const ttyconf = get_tty_conf(color, stderr);
|
||||||
switch (ttyconf) {
|
switch (ttyconf) {
|
||||||
.no_color => try builder.env_map.put("NO_COLOR", "1"),
|
.no_color => try builder.env_map.put("NO_COLOR", "1"),
|
||||||
.escape_codes => try builder.env_map.put("ZIG_DEBUG_COLOR", "1"),
|
.escape_codes => try builder.env_map.put("YES_COLOR", "1"),
|
||||||
.windows_api => {},
|
.windows_api => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,11 +7,11 @@ const native_os = builtin.os.tag;
|
|||||||
|
|
||||||
/// Detect suitable TTY configuration options for the given file (commonly stdout/stderr).
|
/// Detect suitable TTY configuration options for the given file (commonly stdout/stderr).
|
||||||
/// This includes feature checks for ANSI escape codes and the Windows console API, as well as
|
/// This includes feature checks for ANSI escape codes and the Windows console API, as well as
|
||||||
/// respecting the `ZIG_DEBUG_COLOR` and `YES_COLOR` environment variables to override the default.
|
/// respecting the `NO_COLOR` and `YES_COLOR` environment variables to override the default.
|
||||||
pub fn detectConfig(file: File) Config {
|
pub fn detectConfig(file: File) Config {
|
||||||
const force_color: ?bool = if (builtin.os.tag == .wasi)
|
const force_color: ?bool = if (builtin.os.tag == .wasi)
|
||||||
null // wasi does not support environment variables
|
null // wasi does not support environment variables
|
||||||
else if (process.hasEnvVarConstant("ZIG_DEBUG_COLOR"))
|
else if (process.hasEnvVarConstant("NO_COLOR"))
|
||||||
false
|
false
|
||||||
else if (process.hasEnvVarConstant("YES_COLOR"))
|
else if (process.hasEnvVarConstant("YES_COLOR"))
|
||||||
true
|
true
|
||||||
|
|||||||
@ -81,7 +81,7 @@ fn addExpect(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const run = b.addRunArtifact(exe);
|
const run = b.addRunArtifact(exe);
|
||||||
run.removeEnvironmentVariable("ZIG_DEBUG_COLOR");
|
run.removeEnvironmentVariable("YES_COLOR");
|
||||||
run.setEnvironmentVariable("NO_COLOR", "1");
|
run.setEnvironmentVariable("NO_COLOR", "1");
|
||||||
run.expectExitCode(1);
|
run.expectExitCode(1);
|
||||||
run.expectStdOutEqual("");
|
run.expectStdOutEqual("");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user