Skip to content

Commit

Permalink
fix write to file
Browse files Browse the repository at this point in the history
  • Loading branch information
yerke26 committed Oct 28, 2024
1 parent 3001398 commit 2d7386f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/evm/T8NTool/T8NTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ private T8NExecutionResult Execute(

private void WriteToFile(string filename, string? basedir, object outputObject)
{
FileInfo fileInfo = new(basedir + filename);
if (basedir is not null)
{
basedir = basedir.TrimEnd('/');
basedir += '/';
}

var fileInfo = new FileInfo(basedir + filename);

Directory.CreateDirectory(fileInfo.DirectoryName!);
using StreamWriter writer = new(fileInfo.FullName);
writer.Write(_ethereumJsonSerializer.Serialize(outputObject, true));
Expand Down

0 comments on commit 2d7386f

Please sign in to comment.