mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
19 lines
690 B
Zig
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;
|