27 lines
613 B
C#
27 lines
613 B
C#
namespace StellaOps.AirGap.Bundle.Services;
|
|
|
|
public sealed partial class SnapshotBundleWriter
|
|
{
|
|
private string CreateTempDir()
|
|
{
|
|
var tempDir = Path.Combine(Path.GetTempPath(), $"snapshot-{_guidProvider.NewGuid():N}");
|
|
Directory.CreateDirectory(tempDir);
|
|
return tempDir;
|
|
}
|
|
|
|
private static void CleanupTempDir(string tempDir)
|
|
{
|
|
try
|
|
{
|
|
if (Directory.Exists(tempDir))
|
|
{
|
|
Directory.Delete(tempDir, recursive: true);
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// Ignore cleanup errors.
|
|
}
|
|
}
|
|
}
|