Skip to content

Commit

Permalink
add exec to the bunx simlink check
Browse files Browse the repository at this point in the history
  • Loading branch information
RiskyMH committed Feb 5, 2025
1 parent c37d0e4 commit 169b758
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1636,10 +1636,12 @@ pub const Command = struct {
// if we are bunx, but NOT a symlink to bun. when we run `<self> install`, we dont
// want to recursively run bunx. so this check lets us peek back into bun install.
if (args_iter.next()) |next| {
if (bun.strings.eqlComptime(next, "add") and
bun.getenvZ("BUN_INTERNAL_BUNX_INSTALL") != null)
{
return .AddCommand;
if (bun.getRuntimeFeatureFlag("BUN_INTERNAL_BUNX_INSTALL")) {
if (bun.strings.eqlComptime(next, "add")) {
return .AddCommand;
} else if (bun.strings.eqlComptime(next, "exec")) {
return .ExecCommand;
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/cli/bunx_command.zig
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,9 @@ pub const BunxCommand = struct {
.stdout = .inherit,
.stdin = .inherit,

// .windows = if (Environment.isWindows) .{
// .loop = bun.JSC.EventLoopHandle.init(bun.JSC.MiniEventLoop.initGlobal(this_transpiler.env)),
// },
.windows = if (Environment.isWindows) .{
.loop = bun.JSC.EventLoopHandle.init(bun.JSC.MiniEventLoop.initGlobal(this_transpiler.env)),
},
}) catch |err| {
Output.prettyErrorln("<r><red>error<r>: bunx failed to install <b>{s}<r> due to error <b>{s}<r>", .{ install_param, @errorName(err) });
Global.exit(1);
Expand Down

0 comments on commit 169b758

Please sign in to comment.