Skip to content

Commit

Permalink
Fix crash when create new project from another project template.
Browse files Browse the repository at this point in the history
  • Loading branch information
MineBill committed Jan 13, 2024
1 parent 7794efb commit 08886ce
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Seed/Models/ProjectTemplates/LocalTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ public override async void Create(Project newProject)
if (json != null)
json["Name"] = newProject.Name;

await using var writer = new Utf8JsonWriter(new FileStream(flaxproj, FileMode.Create), new JsonWriterOptions
await using (var file = new FileStream(flaxproj, FileMode.Create))
{
Indented = true
});
json?.WriteTo(writer);
await using var writer = new Utf8JsonWriter(file, new JsonWriterOptions
{
Indented = true
});
json?.WriteTo(writer);
}

File.Move(flaxproj, Path.Combine(newProject.Path, newProject.Name + ".flaxproj"));

Expand Down

0 comments on commit 08886ce

Please sign in to comment.