diff options
author | 2021-12-19 14:37:43 -0800 | |
---|---|---|
committer | 2021-12-19 14:37:43 -0800 | |
commit | e12f10ae0ee1a7f3ac266a64a53267c233bbf089 (patch) | |
tree | 518a3580aef1f1d38f31eecc1acf678c6b4cba70 | |
parent | 961b704a8eead881879f1d22e7d9d1fa39a33656 (diff) | |
download | bun-e12f10ae0ee1a7f3ac266a64a53267c233bbf089.tar.gz bun-e12f10ae0ee1a7f3ac266a64a53267c233bbf089.tar.zst bun-e12f10ae0ee1a7f3ac266a64a53267c233bbf089.zip |
[bun install] More git protocols are valid
-rw-r--r-- | src/install/dependency.zig | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/install/dependency.zig b/src/install/dependency.zig index d41cfe8d4..478b6bce6 100644 --- a/src/install/dependency.zig +++ b/src/install/dependency.zig @@ -277,6 +277,15 @@ pub const Version = struct { ) or strings.eqlComptime( dependency[0..@minimum("git+ssh".len, dependency.len)], "git+ssh", + ) or strings.eqlComptime( + dependency[0..@minimum("git+file".len, dependency.len)], + "git+file", + ) or strings.eqlComptime( + dependency[0..@minimum("git+http".len, dependency.len)], + "git+http", + ) or strings.eqlComptime( + dependency[0..@minimum("git+https".len, dependency.len)], + "git+https", )) { return .git; } @@ -516,9 +525,9 @@ pub fn parseWithTag( }; }, .folder => { - if (strings.contains(dependency, "://")) { - if (strings.startsWith(dependency, "file://")) { - return Version{ .value = .{ .folder = sliced.sub(dependency[7..]).value() }, .tag = .folder }; + if (strings.indexOf(dependency, ":")) |protocol| { + if (strings.eqlComptime(dependency[0..protocol], "file")) { + return Version{ .literal = sliced.value(), .value = .{ .folder = sliced.sub(dependency[4..]).value() }, .tag = .folder }; } if (log_) |log| log.addErrorFmt(null, logger.Loc.Empty, allocator, "Unsupported protocol {s}", .{dependency}) catch unreachable; |