mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
* more tests * update migration.zig * fix up paths * update tests * update tests * test * test * update registry tests * comments * early exit if stream is invalid * dont pass invalid_fd to openFileAtWindows * fix merge * misc crash fix * make this use optional pointers instead of 0xaa * ensure absolute paths are propagated properly * package.json expects forward slash * this assert was invalid * add panic checks * pass bun-remove * more panic checks * test: pass bun-add * querying these hangs outside bun too * fix compile error from merge conflict resolution * use compileError instead of comptime unreachable * tidy * bunx: check for the .exe bin extension * bunx: another route to make cache path if it doesnt exist * install: another case of FolderResolution.getOrPut expecting absolute path * fix a bun install crash * dont print zig stack trace if bun install fails * test: pass bun-link * test: bunx: add more expects * test: bun-install-registry: pass * test: bun-install: pass * test: bun-pm: pass * fix merge main error * fix posix tests * fix last failing test in bun-install.test.ts symlink difference between platforms * bun-install-registry.test.ts fix * bun-run.test.ts: remove stray console log --------- Co-authored-by: Meghan Denny <meghan@bun.sh> Co-authored-by: Meghan Denny <hello@nektro.net> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
19 lines
612 B
Zig
19 lines
612 B
Zig
const Command = @import("../cli.zig").Command;
|
|
const bun = @import("root").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.printForLogLevel(bun.Output.errorWriter()) catch {};
|
|
bun.Global.exit(1);
|
|
},
|
|
else => |e| return e,
|
|
};
|
|
}
|
|
};
|