Skip to content

Commit

Permalink
Delete export folder if it exists already
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Apr 20, 2024
1 parent c77beea commit 12dcf90
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ public void Export(string id)
gitPatcher.AutoUpdateToBranchTip = false;
gitPatcher.LatestTag = false;
}
var subDir = "Export";
Directory.CreateDirectory(subDir);
DirectoryPath subDir = "Export";
if (subDir.Exists)
{
subDir.DeleteEntireFolder(deleteFolderItself: false);
}
else
{
Directory.CreateDirectory(subDir);
}
File.WriteAllText(
Path.Combine(subDir, PipelinePaths.Path),
JsonConvert.SerializeObject(pipeSettings, Formatting.Indented, Execution.Constants.JsonSettings));
Expand Down

0 comments on commit 12dcf90

Please sign in to comment.