fix(install): tarball extracting bugfix (#11864)

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Dylan Conway
2024-06-15 00:22:16 -07:00
committed by GitHub
parent eedb3e530c
commit fa952b163c
14 changed files with 357 additions and 182 deletions

View File

@@ -28,7 +28,11 @@ pub inline fn containsChar(self: string, char: u8) bool {
}
pub inline fn contains(self: string, str: string) bool {
return indexOf(self, str) != null;
return containsT(u8, self, str);
}
pub inline fn containsT(comptime T: type, self: []const T, str: []const T) bool {
return indexOfT(T, self, str) != null;
}
pub inline fn removeLeadingDotSlash(slice: []const u8) []const u8 {
@@ -5131,6 +5135,10 @@ pub inline fn charIsAnySlash(char: u8) bool {
}
pub inline fn startsWithWindowsDriveLetter(s: []const u8) bool {
return startsWithWindowsDriveLetterT(u8, s);
}
pub inline fn startsWithWindowsDriveLetterT(comptime T: type, s: []const T) bool {
return s.len > 2 and s[1] == ':' and switch (s[0]) {
'a'...'z', 'A'...'Z' => true,
else => false,