diff --git a/src/install/install.zig b/src/install/install.zig index 617dbcc596..1d40e5ea23 100644 --- a/src/install/install.zig +++ b/src/install/install.zig @@ -9792,7 +9792,7 @@ pub const PackageManager = struct { // add // remove outer: for (positionals) |positional| { - var input: []u8 = @constCast(std.mem.trim(u8, positional, " \n\r\t")); + var input: []u8 = bun.default_allocator.dupe(u8, std.mem.trim(u8, positional, " \n\r\t")) catch bun.outOfMemory(); { var temp: [2048]u8 = undefined; const len = std.mem.replace(u8, input, "\\\\", "/", &temp); diff --git a/test/cli/install/bun-repl.test.ts b/test/cli/install/bun-repl.test.ts new file mode 100644 index 0000000000..466b956029 --- /dev/null +++ b/test/cli/install/bun-repl.test.ts @@ -0,0 +1,7 @@ +import { test, expect } from "bun:test"; +import "harness"; + +// https://github.com/oven-sh/bun/issues/12070 +test("bun repl", () => { + expect(["repl", "-e", "process.exit(0)"]).toRun(); +});