Skip to content

Commit d358f8e

Browse files
committed
Move undocumented environment variable names to a common location
1 parent b996f7b commit d358f8e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependencyManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public DependencyManager(string srcDir, IDependencyOptions options, ILogger logg
111111
logger.LogInfo($"Unresolved reference {r.Key} in project {r.Value}");
112112
}
113113

114-
var webViewExtractionOption = Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_BUILDLESS_EXTRACT_WEB_VIEWS");
114+
var webViewExtractionOption = Environment.GetEnvironmentVariable(EnvironmentVariableNames.WebViewGeneration);
115115
if (webViewExtractionOption == null ||
116116
bool.TryParse(webViewExtractionOption, out var shouldExtractWebViews) &&
117117
shouldExtractWebViews)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Semmle.Extraction.CSharp.DependencyFetching
2+
{
3+
internal class EnvironmentVariableNames
4+
{
5+
public const string WebViewGeneration = "CODEQL_EXTRACTOR_CSHARP_BUILDLESS_EXTRACT_WEB_VIEWS";
6+
public const string MonoPath = "CODEQL_EXTRACTOR_CSHARP_BUILDLESS_MONO_PATH";
7+
}
8+
}

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Runtime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private IEnumerable<string> DesktopRuntimes
8080

8181
string? monoDir = null;
8282

83-
var monoPathEnv = Environment.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_BUILDLESS_MONO_PATH");
83+
var monoPathEnv = Environment.GetEnvironmentVariable(EnvironmentVariableNames.MonoPath);
8484
if (monoPathEnv is not null)
8585
{
8686
if (Directory.Exists(monoPathEnv))
@@ -89,7 +89,7 @@ private IEnumerable<string> DesktopRuntimes
8989
}
9090
else
9191
{
92-
logger.LogError($"The directory specified in CODEQL_EXTRACTOR_CSHARP_BUILDLESS_MONO_PATH does not exist: {monoPathEnv}");
92+
logger.LogError($"The directory specified in {EnvironmentVariableNames.MonoPath} does not exist: {monoPathEnv}");
9393
}
9494
}
9595
else

0 commit comments

Comments
 (0)