mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Take existing files into account when calculating sizes.
This commit is contained in:
parent
d65060b796
commit
4ec2580ca4
@ -86,10 +86,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>1.3.2</Version>
|
||||
<Version>2.0.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>1.3.2</Version>
|
||||
<Version>2.0.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Reactive">
|
||||
<Version>4.2.0</Version>
|
||||
|
@ -297,8 +297,11 @@ namespace Wabbajack.Lib
|
||||
.Do(g =>
|
||||
{
|
||||
var required = g.Sum(i => i.Item2);
|
||||
var contains = g.Sum(folder =>
|
||||
Directory.EnumerateFiles(folder.Item1, "*", DirectoryEnumerationOptions.Recursive)
|
||||
.Sum(file => new FileInfo(file).Length));
|
||||
var available = DriveInfo(g.Key).FreeBytesAvailable;
|
||||
if (required > available)
|
||||
if (required - contains > available)
|
||||
throw new NotEnoughDiskSpaceException(
|
||||
$"This modlist requires {required.ToFileSizeString()} on {g.Key} but only {available.ToFileSizeString()} is available.");
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user