feat: exergize globs

This commit is contained in:
tresabhi committed 2025-01-26 17:03:49 -06:00
1 parent 4c16af918d
commit 68fd8fcfc5
4 files changed
+22 -4

No files matched your search

+2 -1
View File
@@ -37,7 +37,8 @@
"build:reviews": "cd packages/scripts && bun build:reviews", "build:reviews": "cd packages/scripts && bun build:reviews",
"build:ids": "cd packages/scripts && bun build:ids", "build:ids": "cd packages/scripts && bun build:ids",
"prunestrings": "cd packages/scripts && bun prunestrings", "prunestrings": "cd packages/scripts && bun prunestrings",
"dev:cli:unpack": "cd src/CLI && dotnet run unpack \"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest\"" "dev:cli:unpack": "cd src/CLI && dotnet run unpack \"C:/Program Files (x86)/Steam/steamapps/common/World of Tanks Blitz Playtest\"",
"dev:cli:test": "cd src/CLI && dotnet run test"
}, },
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
+4
View File
@@ -9,4 +9,8 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="../../submodules/CUE4Parse/CUE4Parse/CUE4Parse.csproj" /> <ProjectReference Include="../../submodules/CUE4Parse/CUE4Parse/CUE4Parse.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
</ItemGroup>
</Project> </Project>
+10 -3
View File
@@ -4,6 +4,7 @@ using CLI.Utils;
using CUE4Parse.FileProvider.Objects; using CUE4Parse.FileProvider.Objects;
using CUE4Parse.UE4.Pak; using CUE4Parse.UE4.Pak;
using CUE4Parse.UE4.Readers; using CUE4Parse.UE4.Readers;
using DotNet.Globbing;
namespace CLI.Functions namespace CLI.Functions
{ {
@@ -185,12 +186,18 @@ namespace CLI.Functions
} }
} }
private static string[] ExergizableFiles = ["Blitz/Config/DefaultDlc.ini"]; private static readonly string[] ExergizableGlobsRaw =
[
"Blitz/Config/DefaultDlc.ini",
"Blitz/Content/Tanks/**",
"Blitz/Content/TankSets/*",
];
private static readonly Glob[] ExergizableGlobs = [.. ExergizableGlobsRaw.Select(Glob.Parse)];
private static bool ShouldExergize(string path) private static bool ShouldExergize(string path)
{ {
return true; // return true;
// return ExergizableFiles.Contains(path); return ExergizableGlobs.Any(glob => glob.IsMatch(path));
} }
} }
} }
+6
View File
@@ -14,6 +14,12 @@ namespace CLI
break; break;
} }
case "test":
{
Test.Run(args);
break;
}
default: default:
{ {
throw new ArgumentException("Invalid command"); throw new ArgumentException("Invalid command");