From 25a09d8858882ae6eaffdc9dfcd897bf3023f04e Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sat, 8 Jun 2024 23:07:15 -0700 Subject: [PATCH] Disable `bun patch` in release builds until #11719 is fixed cc @zackradisic --- src/cli/patch_command.zig | 6 ++++++ src/cli/patch_commit_command.zig | 6 ++++++ src/feature_flags.zig | 2 ++ 3 files changed, 14 insertions(+) diff --git a/src/cli/patch_command.zig b/src/cli/patch_command.zig index bc211fef24..1eb55554c0 100644 --- a/src/cli/patch_command.zig +++ b/src/cli/patch_command.zig @@ -1,8 +1,14 @@ +const bun = @import("root").bun; const Command = @import("../cli.zig").Command; const PackageManager = @import("../install/install.zig").PackageManager; pub const PatchCommand = struct { pub fn exec(ctx: Command.Context) !void { + if (!bun.FeatureFlags.is_patch_cmd_enabled) { + bun.Output.prettyErrorln("bun patch is not available in this version of bun. Stay tuned.", .{}); + bun.Global.exit(1); + } + try PackageManager.patch(ctx); } }; diff --git a/src/cli/patch_commit_command.zig b/src/cli/patch_commit_command.zig index fd8490e65c..c54e69d019 100644 --- a/src/cli/patch_commit_command.zig +++ b/src/cli/patch_commit_command.zig @@ -1,8 +1,14 @@ const Command = @import("../cli.zig").Command; const PackageManager = @import("../install/install.zig").PackageManager; +const bun = @import("root").bun; pub const PatchCommitCommand = struct { pub fn exec(ctx: Command.Context) !void { + if (!bun.FeatureFlags.is_patch_cmd_enabled) { + bun.Output.prettyErrorln("bun patch is not available in this version of bun. Stay tuned.", .{}); + bun.Global.exit(1); + } + try PackageManager.patchCommit(ctx); } }; diff --git a/src/feature_flags.zig b/src/feature_flags.zig index 93bb8f0309..74447ced76 100644 --- a/src/feature_flags.zig +++ b/src/feature_flags.zig @@ -179,3 +179,5 @@ pub const breaking_changes_1_2 = false; // order than via Bun.file.writer() so we turn it off until there's a unified, // buffered writer abstraction shared throughout Bun pub const nonblocking_stdout_and_stderr_on_posix = false; + +pub const is_patch_cmd_enabled = env.is_canary or env.isDebug;