Skip to content

Commit

Permalink
Create directories when writing new Base64 data
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx committed Jul 28, 2021
1 parent d31b8d8 commit 3150d45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sonic-06-Mod-Manager/src/UnifyPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ public static void InstallPatches(string patch, string name)

// Convert and write Base64 to a binary file
byte[] bytes = Convert.FromBase64String(_WriteBase64[1]);

// Create directory in case it doesn't exist
Directory.CreateDirectory(Path.GetDirectoryName(_Base64Location));

// Write Base64 data
File.WriteAllBytes(_Base64Location, bytes);

break;
Expand Down

0 comments on commit 3150d45

Please sign in to comment.