Skip to content

Commit

Permalink
Merge pull request #20 from tyronbrand/path-fix
Browse files Browse the repository at this point in the history
use path.combine
  • Loading branch information
tyronbrand authored Oct 21, 2021
2 parents aa80ad7 + 2e0f858 commit eab579e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Flow.Net.SDK/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ public static FlowConfig ReadConfig(string fileName = null, string path = null)
if (string.IsNullOrEmpty(path))
path = AppContext.BaseDirectory;

var file = File.ReadAllText($"{path}\\{fileName}.json");
var file = File.ReadAllText(Path.Combine(path, $"{fileName}.json"));
return JsonConvert.DeserializeObject<FlowConfig>(file);
}

public static string ReadCadenceScript(string fileName, string path = null)
{
if (string.IsNullOrEmpty(path))
path = $"{AppContext.BaseDirectory}\\Cadence";
path = Path.Combine(AppContext.BaseDirectory, "Cadence");

return File.ReadAllText($"{path}\\{fileName}.cdc");
return File.ReadAllText(Path.Combine(path, $"{fileName}.cdc"));
}

public static byte[] Pad(string tag, int length, bool padLeft = true)
Expand Down

0 comments on commit eab579e

Please sign in to comment.