QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142) getrackt, ohne .gitmodules und ohne erreichbares Remote. Der Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen. Umstellung: - Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6) - Gitlink aus dem Index entfernt - Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
50 lines
1.6 KiB
C#
50 lines
1.6 KiB
C#
using System;
|
|
|
|
namespace Centron.Scripts
|
|
{
|
|
public static class EnvironmentHelper
|
|
{
|
|
public static string GetEnvironmentVariable(string name)
|
|
{
|
|
var targets = new[]
|
|
{
|
|
EnvironmentVariableTarget.Process,
|
|
EnvironmentVariableTarget.User,
|
|
EnvironmentVariableTarget.Machine
|
|
};
|
|
|
|
foreach (var target in targets)
|
|
{
|
|
var value = Environment.GetEnvironmentVariable(name, target);
|
|
|
|
if (string.IsNullOrWhiteSpace(value) == false)
|
|
return value;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static bool IsDevBuild()
|
|
{
|
|
// IsDevBuild is true by default
|
|
// It is only supposed to be false, when it's set through the environment variable to false
|
|
string environmentVariable = GetEnvironmentVariable(EnvironmentVariables.IsDevBuild);
|
|
bool isDevBuild = bool.TryParse(environmentVariable, out var f) ? f : true;
|
|
|
|
return isDevBuild;
|
|
}
|
|
|
|
public static bool RunningInAzurePipelines()
|
|
{
|
|
string environmentVariable = GetEnvironmentVariable(EnvironmentVariables.RunningInAzurePipelines);
|
|
return bool.TryParse(environmentVariable, out var f) ? f : false;
|
|
}
|
|
|
|
public static bool UseLongTimeout()
|
|
{
|
|
string environmentVariable = GetEnvironmentVariable(EnvironmentVariables.UseLongTimeout);
|
|
return bool.TryParse(environmentVariable, out var f) ? f : false;
|
|
}
|
|
}
|
|
}
|