aboutsummaryrefslogtreecommitdiff
path: root/src/cli/bunx_command.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-14 12:58:30 -0700
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-14 12:58:30 -0700
commitf9add8b6bea4df3cdbd56a21f17e4cab1a854e4e (patch)
tree8e5306104d81c67b771181337bba02cd9ec39453 /src/cli/bunx_command.zig
parent81a1a58d66c598ea35c42453d0ba4c6341a940fc (diff)
parent9b5e66453b0879ed77b71dcdbe50e4efa184261e (diff)
downloadbun-sdl.tar.gz
bun-sdl.tar.zst
bun-sdl.zip
Merge branch 'main' into sdlsdl
Diffstat (limited to 'src/cli/bunx_command.zig')
-rw-r--r--src/cli/bunx_command.zig24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/cli/bunx_command.zig b/src/cli/bunx_command.zig
index dba2d5664..e7f35d10d 100644
--- a/src/cli/bunx_command.zig
+++ b/src/cli/bunx_command.zig
@@ -236,6 +236,8 @@ pub const BunxCommand = struct {
const initial_bin_name = if (strings.eqlComptime(update_request.name, "typescript"))
"tsc"
+ else if (update_request.version.tag == .github)
+ update_request.version.value.github.repo.slice(update_request.version_buf)
else if (strings.lastIndexOfChar(update_request.name, '/')) |index|
update_request.name[index + 1 ..]
else
@@ -262,19 +264,19 @@ pub const BunxCommand = struct {
else
update_request.version.literal.slice(update_request.version_buf);
- const package_fmt: []const u8 = brk: {
- if (!strings.eql(update_request.version_buf, update_request.name)) {
- break :brk try std.fmt.allocPrint(
- ctx.allocator,
- "{s}@{s}",
- .{
- update_request.name,
- display_version,
- },
- );
+ const package_fmt = brk: {
+ if (update_request.version.tag == .github) {
+ break :brk update_request.version.literal.slice(update_request.version_buf);
}
- break :brk update_request.name;
+ break :brk try std.fmt.allocPrint(
+ ctx.allocator,
+ "{s}@{s}",
+ .{
+ update_request.name,
+ display_version,
+ },
+ );
};
const PATH_FOR_BIN_DIRS = PATH;