Skip to content

Commit

Permalink
[EXILED::Events] Fix downloading NWAPI plugins with hub install (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bladuk authored Sep 30, 2024
1 parent 816e979 commit 244172f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions EXILED/Exiled.Events/Commands/Hub/Install.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
releaseToDownload = foundRelease;
}

Log.Info($"Downloading release \"{releaseToDownload.TagName}\". Found {releaseToDownload.Assets.Length} asset(s) to download.");
ReleaseAsset[] releaseAssets = releaseToDownload.Assets.Where(x => x.Name.IndexOf("nwapi", StringComparison.OrdinalIgnoreCase) == -1).ToArray();

foreach (ReleaseAsset asset in releaseToDownload.Assets)
Log.Info($"Downloading release \"{releaseToDownload.TagName}\". Found {releaseAssets.Length} asset(s) to download.");

foreach (ReleaseAsset asset in releaseAssets)
{
Log.Info($"Downloading asset {asset.Name}. Asset size: {Math.Round(asset.Size / 1000f, 2)} KB.");
using HttpResponseMessage assetResponse = client.GetAsync(asset.BrowserDownloadUrl).ConfigureAwait(false).GetAwaiter().GetResult();
Expand Down

0 comments on commit 244172f

Please sign in to comment.