in TeamCity.CSharpInteractive/Environment.cs [21:53]
public string GetPath(SpecialFolder specialFolder)
{
switch (OperatingSystemPlatform)
{
case Platform.Windows:
return specialFolder switch
{
SpecialFolder.Bin => GetBinDirectory(),
SpecialFolder.Temp => Path.GetFullPath(System.Environment.GetEnvironmentVariable("TMP") ?? Path.GetTempPath()),
SpecialFolder.ProgramFiles => System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFiles),
SpecialFolder.Script => GetScriptDirectory(),
SpecialFolder.Working => GetWorkingDirectory(),
_ => throw new ArgumentOutOfRangeException(nameof(specialFolder), specialFolder, null)
};
case Platform.Unknown:
case Platform.Linux:
case Platform.Darwin:
case Platform.FreeBSD:
return specialFolder switch
{
SpecialFolder.Bin => GetBinDirectory(),
SpecialFolder.Temp => Path.GetFullPath(System.Environment.GetEnvironmentVariable("TMPDIR") ?? Path.GetTempPath()),
SpecialFolder.ProgramFiles => "usr/local/share",
SpecialFolder.Script => GetScriptDirectory(),
SpecialFolder.Working => GetWorkingDirectory(),
_ => throw new ArgumentOutOfRangeException(nameof(specialFolder), specialFolder, null)
};
default:
throw new ArgumentOutOfRangeException(nameof(specialFolder));
}
}