fix(ci): make launcher space guidance culture invariant
This commit is contained in:
parent
cccae4169a
commit
45ba42a3a7
2 changed files with 35 additions and 21 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using AcDream.Launcher.Core.Integrity;
|
||||
using AcDream.Launcher.Core.Launching;
|
||||
using AcDream.Platform;
|
||||
using System.Globalization;
|
||||
|
||||
namespace AcDream.Launcher.Core.Installation;
|
||||
|
||||
|
|
@ -326,9 +327,9 @@ public sealed class LauncherInstaller : ILauncherInstaller
|
|||
{
|
||||
string message =
|
||||
$"The optimized world-data rebuild needs at least "
|
||||
+ $"{FullRebuildRequiredFreeBytes / (1024d * 1024d * 1024d):N1} GiB free "
|
||||
+ $"{FormatGiB(FullRebuildRequiredFreeBytes)} GiB free "
|
||||
+ $"beside the active package; only "
|
||||
+ $"{availableBytes / (1024d * 1024d * 1024d):N1} GiB is available.";
|
||||
+ $"{FormatGiB(availableBytes)} GiB is available.";
|
||||
Report(progress, LauncherInstallPhase.Failed, message);
|
||||
throw new LauncherInstallException(message);
|
||||
}
|
||||
|
|
@ -636,6 +637,9 @@ public sealed class LauncherInstaller : ILauncherInstaller
|
|||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private static string FormatGiB(long bytes) =>
|
||||
(bytes / (1024d * 1024d * 1024d)).ToString("N1", CultureInfo.InvariantCulture);
|
||||
|
||||
public async Task<LauncherInstallResult> ApplyContentUpdateAsync(
|
||||
string datDirectory,
|
||||
int threads,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Text.Json.Nodes;
|
||||
using AcDream.Launcher.Core.Integrity;
|
||||
using AcDream.Launcher.Core.Installation;
|
||||
|
|
@ -149,6 +150,10 @@ public sealed class LauncherInstallerTests : IDisposable
|
|||
|
||||
[Fact]
|
||||
public async Task InsufficientFreeSpaceStopsBeforeBakeAndReportsExactRequirement()
|
||||
{
|
||||
CultureInfo originalCulture = CultureInfo.CurrentCulture;
|
||||
CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("sv-SE");
|
||||
try
|
||||
{
|
||||
bool childStarted = false;
|
||||
var runner = new FakeBakeProcessRunner((_, _, _) =>
|
||||
|
|
@ -173,6 +178,11 @@ public sealed class LauncherInstallerTests : IDisposable
|
|||
LauncherInstaller.GetFullRebuildCandidatePath(
|
||||
Path.Combine(_paths.DataDirectory, "pak", "acdream.pak"))));
|
||||
}
|
||||
finally
|
||||
{
|
||||
CultureInfo.CurrentCulture = originalCulture;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task FullContentMigrationPersistsClientGateAcrossLauncherRestart()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue