Skip to content

Commit d4f4e2f

Browse files
Fixed error with update clone command
1 parent 2d37a7d commit d4f4e2f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Source/HedgeModManager/Updates/HMMUpdateCommand.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public async Task ProcessAsync(string root, CancellationToken? c)
6363
string otherFileLocalPath = Path.Combine(root, otherFile.Path);
6464
if (File.Exists(otherFileLocalPath))
6565
{
66+
string? parentDir = Path.GetDirectoryName(localPath);
67+
if (parentDir != null && !Directory.Exists(parentDir))
68+
{
69+
Logger.Debug($"Creating parent directory \"{parentDir}\"...");
70+
Directory.CreateDirectory(parentDir);
71+
}
6672
Logger.Debug($"Copying file \"{otherFileLocalPath}\" to \"{localPath}\"");
6773
File.Copy(otherFileLocalPath, localPath, true);
6874
}

0 commit comments

Comments
 (0)