add Fetch support for short compressed tar ext

these short extensions are common in a lot of
places, and should be treated like their double
versions
This commit is contained in:
Tobias Simetsreiter 2023-10-24 11:35:28 +02:00 committed by Andrew Kelley
parent 8087ec8e8c
commit d1230842ac

View File

@ -761,8 +761,11 @@ const FileType = enum {
fn fromPath(file_path: []const u8) ?FileType {
if (ascii.endsWithIgnoreCase(file_path, ".tar")) return .tar;
if (ascii.endsWithIgnoreCase(file_path, ".tgz")) return .@"tar.gz";
if (ascii.endsWithIgnoreCase(file_path, ".tar.gz")) return .@"tar.gz";
if (ascii.endsWithIgnoreCase(file_path, ".txz")) return .@"tar.xz";
if (ascii.endsWithIgnoreCase(file_path, ".tar.xz")) return .@"tar.xz";
if (ascii.endsWithIgnoreCase(file_path, ".tzst")) return .@"tar.zst";
if (ascii.endsWithIgnoreCase(file_path, ".tar.zst")) return .@"tar.zst";
return null;
}