Files
bun.sh/src/cli/update_command.zig
taylor.fish 07cd45deae Refactor Zig imports and file structure (part 1) (#21270)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-07-22 17:51:38 -07:00

19 lines
690 B
Zig

pub const UpdateCommand = struct {
pub fn exec(ctx: Command.Context) !void {
const cli = try PackageManager.CommandLineArguments.parse(ctx.allocator, .update);
if (cli.interactive) {
const UpdateInteractiveCommand = @import("./update_interactive_command.zig").UpdateInteractiveCommand;
try UpdateInteractiveCommand.exec(ctx);
} else {
try updatePackageJSONAndInstallCatchError(ctx, .update);
}
}
};
const bun = @import("bun");
const Command = bun.cli.Command;
const PackageManager = bun.install.PackageManager;
const updatePackageJSONAndInstallCatchError = PackageManager.updatePackageJSONAndInstallCatchError;