mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: exergize globs
This commit is contained in:
1 parent
4c16af918d
commit
68fd8fcfc5
4 files changed
+22
-4
No files matched your search
+2
-1
@@ -37,7 +37,8 @@
|
||||
"build:reviews": "cd packages/scripts && bun build:reviews",
|
||||
"build:ids": "cd packages/scripts && bun build:ids",
|
||||
"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",
|
||||
"dependencies": {
|
||||
|
||||
@@ -9,4 +9,8 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../../submodules/CUE4Parse/CUE4Parse/CUE4Parse.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotNet.Glob" Version="3.1.3" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -4,6 +4,7 @@ using CLI.Utils;
|
||||
using CUE4Parse.FileProvider.Objects;
|
||||
using CUE4Parse.UE4.Pak;
|
||||
using CUE4Parse.UE4.Readers;
|
||||
using DotNet.Globbing;
|
||||
|
||||
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)
|
||||
{
|
||||
return true;
|
||||
// return ExergizableFiles.Contains(path);
|
||||
// return true;
|
||||
return ExergizableGlobs.Any(glob => glob.IsMatch(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,12 @@ namespace CLI
|
||||
break;
|
||||
}
|
||||
|
||||
case "test":
|
||||
{
|
||||
Test.Run(args);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
throw new ArgumentException("Invalid command");
|
||||
|
||||
Reference in new issue
Block a user