From e53fc83dc278170bdeb5b92abfa679eae5ed0647 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 04:49:29 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- src/shell/interpreter.zig | 10 +++++----- test/js/bun/shell/bunshell.test.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/shell/interpreter.zig b/src/shell/interpreter.zig index 2bd94de5bb..1bafc4d03e 100644 --- a/src/shell/interpreter.zig +++ b/src/shell/interpreter.zig @@ -777,13 +777,13 @@ pub const Interpreter = struct { var env_map = if (export_env_) |e| e else env_blk: { // Initialize with current process environment for Bun.$ when no env provided var env = EnvMap.init(allocator); - + // Copy current process environment for (std.os.environ) |env_ptr| { const env_str = bun.span(env_ptr); if (bun.strings.indexOfChar(env_str, '=')) |eq_index| { const key = env_str[0..eq_index]; - const value = env_str[eq_index + 1..]; + const value = env_str[eq_index + 1 ..]; if (key.len > 0) { const key_envstr = EnvStr.initSlice(key); const value_envstr = EnvStr.initSlice(value); @@ -791,10 +791,10 @@ pub const Interpreter = struct { } } } - + break :env_blk env; }; - + // Always set SHELL environment variable to Bun executable path for Bun.$ if (bun.selfExePath()) |self_exe_path| { const shell_key = EnvStr.initSlice("SHELL"); @@ -806,7 +806,7 @@ pub const Interpreter = struct { const shell_value = EnvStr.initSlice("bun"); env_map.insert(shell_key, shell_value); } - + break :brk env_map; } diff --git a/test/js/bun/shell/bunshell.test.ts b/test/js/bun/shell/bunshell.test.ts index d932c61042..9080bc54fc 100644 --- a/test/js/bun/shell/bunshell.test.ts +++ b/test/js/bun/shell/bunshell.test.ts @@ -448,10 +448,10 @@ describe("bunshell", () => { test("should be set to Bun executable path", async () => { const { stdout } = await $`echo $SHELL`; const shellPath = stdout.toString().trim(); - + // Should contain "bun" in the path expect(shellPath).toContain("bun"); - + // Should be an absolute path expect(shellPath).toMatch(/^\/|^[A-Z]:\\/); }); @@ -459,12 +459,12 @@ describe("bunshell", () => { test("should be set in shell scripts", async () => { const tempdir = tmpdirSync(); const scriptPath = join(tempdir, "test_shell.sh"); - + // Create a shell script that prints SHELL await Bun.write(scriptPath, 'echo "SHELL: $SHELL"'); - + const result = await $`bun ${scriptPath}`.text(); - + expect(result).toContain("SHELL:"); expect(result).toContain("bun"); });