mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
19 lines
596 B
Zig
19 lines
596 B
Zig
const Command = @import("../cli.zig").Command;
|
|
const bun = @import("bun");
|
|
const PackageManager = @import("../install/install.zig").PackageManager;
|
|
|
|
pub const InstallCommand = struct {
|
|
pub fn exec(ctx: Command.Context) !void {
|
|
PackageManager.install(ctx) catch |err| switch (err) {
|
|
error.InstallFailed,
|
|
error.InvalidPackageJSON,
|
|
=> {
|
|
const log = &bun.CLI.Cli.log_;
|
|
log.print(bun.Output.errorWriter()) catch {};
|
|
bun.Global.exit(1);
|
|
},
|
|
else => |e| return e,
|
|
};
|
|
}
|
|
};
|