Skip to content

Commit

Permalink
Create dir if not exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Oct 16, 2023
1 parent b89e06e commit 31532bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/IKVM.MSBuild.Tasks/IkvmReferenceExportItemPrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ internal async Task SaveStateAsync()
await fileIdentityUtil.SaveStateXmlAsync(fileIdentityStateXml);
root.Add(fileIdentityStateXml);

var dir = Path.GetDirectoryName(StateFile);
if (Directory.Exists(dir) == false)
Directory.CreateDirectory(dir);

root.Save(StateFile);
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/IKVM.MSBuild.Tasks/IkvmReferenceItemPrepare.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ internal async Task SaveStateAsync()
await fileIdentityUtil.SaveStateXmlAsync(fileIdentityStateXml);
root.Add(fileIdentityStateXml);

var dir = Path.GetDirectoryName(StateFile);
if (Directory.Exists(dir) == false)
Directory.CreateDirectory(dir);

root.Save(StateFile);
}
}
Expand Down

0 comments on commit 31532bf

Please sign in to comment.