summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-19 20:22:01 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-19 20:22:01 -0500
commitb6cc17112d95345de83348dd918ed1f7711926f4 (patch)
tree3581dd8c2fd5fdff8bfcdf277e7a8815d739325d /src/SMAPI/Framework/ModHelpers
parentc38c2b2c41b97ae7f7e46a4010107221a0e47c91 (diff)
downloadSMAPI-b6cc17112d95345de83348dd918ed1f7711926f4.tar.gz
SMAPI-b6cc17112d95345de83348dd918ed1f7711926f4.tar.bz2
SMAPI-b6cc17112d95345de83348dd918ed1f7711926f4.zip
normalise path separators in read/write JSON file methods exposed to mods
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers')
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModHelper.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/ModHelper.cs b/src/SMAPI/Framework/ModHelpers/ModHelper.cs
index c73dc307..07dada7e 100644
--- a/src/SMAPI/Framework/ModHelpers/ModHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ModHelper.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using StardewModdingAPI.Framework.Serialisation;
+using StardewModdingAPI.Framework.Utilities;
namespace StardewModdingAPI.Framework.ModHelpers
{
@@ -108,7 +109,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
public TModel ReadJsonFile<TModel>(string path)
where TModel : class
{
- path = Path.Combine(this.DirectoryPath, path);
+ path = Path.Combine(this.DirectoryPath, PathUtilities.NormalisePathSeparators(path));
return this.JsonHelper.ReadJsonFile<TModel>(path);
}
@@ -119,7 +120,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
public void WriteJsonFile<TModel>(string path, TModel model)
where TModel : class
{
- path = Path.Combine(this.DirectoryPath, path);
+ path = Path.Combine(this.DirectoryPath, PathUtilities.NormalisePathSeparators(path));
this.JsonHelper.WriteJsonFile(path, model);
}