From c01cba3ab5baddc19fd2d3bee4b1e8f58738f299 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Tue, 20 Sep 2022 23:57:45 -0700 Subject: [PATCH] Update types.zig --- src/bun.js/node/types.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bun.js/node/types.zig b/src/bun.js/node/types.zig index e54cda08f6..838c6e2e28 100644 --- a/src/bun.js/node/types.zig +++ b/src/bun.js/node/types.zig @@ -1809,12 +1809,14 @@ pub const Process = struct { ) catch unreachable; var args_list = std.ArrayListUnmanaged(JSC.ZigString){ .items = args, .capacity = args.len }; args_list.items.len = 0; + + // get the bun executable + // without paying the cost of a syscall to resolve the full path if (std.process.args().next()) |arg0| { std.debug.assert(arg0.len > 0); args_list.appendAssumeCapacity( JSC.ZigString.init( - // cheap way to get the first argument bun.span(arg0), ).withEncoding(), );