build: initial project release
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m12s
default / dotnet-default-workflow (push) Successful in 1m14s

This commit is contained in:
Louis Seubert 2026-01-20 22:41:16 +01:00
commit 0de3af3033
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
59 changed files with 4903 additions and 0 deletions

View file

@ -0,0 +1,32 @@
// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
namespace Geekeey.Process.Tests;
internal sealed class TestEnvironment : IDisposable
{
private readonly Action _action;
private TestEnvironment(Action action)
{
_action = action;
}
public static TestEnvironment Create(string name, string? value)
{
var lastValue = Environment.GetEnvironmentVariable(name);
Environment.SetEnvironmentVariable(name, value);
return new TestEnvironment(() => Environment.SetEnvironmentVariable(name, lastValue));
}
public static TestEnvironment ExtendPath(string path)
{
return Create("PATH", Environment.GetEnvironmentVariable("PATH") + Path.PathSeparator + path);
}
public void Dispose()
{
_action();
}
}