Skip to content

Commit e493484

Browse files
committed
Merge #4440 Fix Missions folder cloning and hard link info retrieval
2 parents 327e771 + 48a73df commit e493484

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ All notable changes to this project will be documented in this file.
3030
- [Netkan] Exclude internal .ckan files from `install_size` (#4348 by: HebaruSan)
3131
- [Core] Generate and tidy up XML docs for Core (#4351 by: HebaruSan)
3232
- [Core] Use setter instead of reflection to set max transaction timeout (#4365 by: doinkythederp; reviewed: HebaruSan)
33-
- [Build] Coverage and more tests (#4383, #4396, #4408, #4420, #4422, #4423, #4425, #4426, #4429, #4435, #4439 by: HebaruSan)
33+
- [Build] Coverage and more tests (#4383, #4396, #4408, #4420, #4422, #4423, #4425, #4426, #4429, #4435, #4439, #4440 by: HebaruSan)
3434
- [Multiple] Switch Inflator from Mono to dotnet (#4387 by: HebaruSan)
3535
- [Multiple] Migrate metadata tester from Mono to dotnet (#4390 by: HebaruSan)
3636
- [Multiple] Writethrough when saving files, add Netkan tests (#4392 by: HebaruSan)

Core/GameInstanceManager.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using CKAN.Games;
1616
using CKAN.Games.KerbalSpaceProgram;
1717
using CKAN.Games.KerbalSpaceProgram.GameVersionProviders;
18+
using CKAN.DLC;
1819

1920
namespace CKAN
2021
{
@@ -324,7 +325,7 @@ public void CloneInstance(GameInstance existingInstance,
324325
/// <exception cref="InstanceNameTakenKraken">Thrown if the instance name is already in use.</exception>
325326
/// <exception cref="NotGameDirKraken">Thrown by AddInstance() if created instance is not valid, e.g. if a write operation didn't complete for whatever reason.</exception>
326327
public void FakeInstance(IGame game, string newName, string newPath, GameVersion version,
327-
Dictionary<DLC.IDlcDetector, GameVersion>? dlcs = null)
328+
Dictionary<IDlcDetector, GameVersion>? dlcs = null)
328329
{
329330
TxFileManager fileMgr = new TxFileManager();
330331
using (TransactionScope transaction = CkanTransaction.CreateTransactionScope())
@@ -375,11 +376,8 @@ public void FakeInstance(IGame game, string newName, string newPath, GameVersion
375376
// Create the needed folder structure and the readme.txt for DLCs that should be simulated.
376377
if (dlcs != null)
377378
{
378-
foreach (KeyValuePair<DLC.IDlcDetector, GameVersion> dlc in dlcs)
379+
foreach ((IDlcDetector dlcDetector, GameVersion dlcVersion) in dlcs)
379380
{
380-
DLC.IDlcDetector dlcDetector = dlc.Key;
381-
GameVersion dlcVersion = dlc.Value;
382-
383381
if (!dlcDetector.AllowedOnBaseVersion(version))
384382
{
385383
throw new WrongGameVersionKraken(

Core/Games/KerbalSpaceProgram.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public string PrimaryModDirectory(GameInstance inst)
7272
"saves",
7373
"Screenshots",
7474
"thumbs",
75-
"Missions",
7675
"Logs",
7776
"CKAN/history",
7877
"CKAN/downloads",

Core/IO/HardLink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private enum StatArg
175175
foreach (var pathsString in LimitedStringJoins(paths.Select(p => $"\"{p}\""),
176176
" ", STAT_ARG_MAX))
177177
{
178-
if (Process.Start(new ProcessStartInfo("stat", $"-c '{fmt}' {pathsString}")
178+
if (Process.Start(new ProcessStartInfo("stat", $"-c \"{fmt}\" {pathsString}")
179179
{
180180
UseShellExecute = false,
181181
RedirectStandardOutput = true,

Core/Utilities.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,10 @@ private static void CopyDirectory(string sourceDirPath,
117117
// Get the files in the directory and copy them to the new location
118118
foreach (var file in sourceDir.GetFiles())
119119
{
120-
if (file.Name == "registry.locked")
120+
if (file.Name is "registry.locked" or "playtime.json")
121121
{
122122
continue;
123123
}
124-
125-
else if (file.Name == "playtime.json")
126-
{
127-
continue;
128-
}
129-
130124
InstalledFilesDeduplicator.CreateOrCopy(file,
131125
Path.Combine(destDirPath, file.Name),
132126
file_transaction);

0 commit comments

Comments
 (0)