summary refs log tree commit diff
path: root/ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-23 02:03:20 +0100
committerRory& <root@rory.gay>2026-02-23 02:03:20 +0100
commit77a609758bb80bac9497d2e3988550f8be578407 (patch)
tree991a9d258ca4fece1132a1a344d0fe11e3b03d51 /ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs
downloadReferenceClientProxyImplementation-77a609758bb80bac9497d2e3988550f8be578407.tar.xz
Initial commit HEAD master
Diffstat (limited to 'ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs')
-rw-r--r--ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs b/ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs
new file mode 100644

index 0000000..60e7ddc --- /dev/null +++ b/ReferenceClientProxyImplementation/Tasks/Startup/PatchClientAssetsTask.cs
@@ -0,0 +1,37 @@ +// using ReferenceClientProxyImplementation.Configuration; +// +// namespace ReferenceClientProxyImplementation.Tasks.Startup; +// +// public class PatchClientAssetsTask(ProxyConfiguration proxyConfig) : ITask { +// public int GetOrder() => 100; +// +// public string GetName() => "Patch client assets"; +// +// public async Task Execute() { +// // foreach (var file in Directory.GetFiles(proxyConfig.AssetCache.DiskCachePath).Where(x => x.EndsWith(".js"))) +// // { +// // var start = DateTime.Now; +// // if(proxyConfig.Logging.LogClientPatching) Console.Write($"[Client Patcher] Patching file {file}..."); +// // var contents = File.ReadAllText(file); +// // contents = AssetsController.PatchClient(contents); +// // File.WriteAllText(file, contents); +// // if(proxyConfig.Logging.LogClientPatching) Console.WriteLine($" Done in {DateTime.Now - start}!"); +// // } +// // +// // if (proxyConfig.Debug.ReformatAssets) +// // { +// // Console.WriteLine("[Client Patcher] Reformatting assets..."); +// // foreach (var file in Directory.GetFiles(proxyConfig.AssetCache.DiskCachePath)) +// // { +// // var target = file.Replace(proxyConfig.AssetCache.DiskCachePath, proxyConfig.TestClient.DebugOptions.FormattedAssetPath); +// // if(!File.Exists(target)) +// // File.Copy(file, target, false); +// // } +// // +// // Process.Start("npx", "prettier -w " + proxyConfig.Debug.FormattedAssetPath).WaitForExit(); +// // Console.WriteLine("[Client Patcher] Done!"); +// // if (proxyConfig.Debug.OpenFormattedDirAfterReformat) +// // Process.Start(proxyConfig.Debug.OpenFormattedDirCommand.Command, proxyConfig.Debug.OpenFormattedDirCommand.Args.Replace("$dir", proxyConfig.Debug.FormattedAssetPath)); +// // } +// } +// } \ No newline at end of file