From 3cfc27245338cde5416176473b554226df693ef2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 11 Oct 2017 15:31:29 -0400 Subject: [PATCH] fix mod deploy failing to create subfolders if they don't already exist --- src/SMAPI.ModBuildConfig/DeployModTask.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SMAPI.ModBuildConfig/DeployModTask.cs b/src/SMAPI.ModBuildConfig/DeployModTask.cs index a09dd5d2..a5725a81 100644 --- a/src/SMAPI.ModBuildConfig/DeployModTask.cs +++ b/src/SMAPI.ModBuildConfig/DeployModTask.cs @@ -96,11 +96,14 @@ namespace StardewModdingAPI.ModBuildConfig /// The folder path to create with the mod files. private void CreateModFolder(IDictionary files, string modFolderPath) { - Directory.CreateDirectory(modFolderPath); foreach (var entry in files) { string fromPath = entry.Value.FullName; string toPath = Path.Combine(modFolderPath, entry.Key); + + // ReSharper disable once AssignNullToNotNullAttribute -- not applicable in this context + Directory.CreateDirectory(Path.GetDirectoryName(toPath)); + File.Copy(fromPath, toPath, overwrite: true); } }