fix: allow optional Preview automation paths
This commit is contained in:
@@ -35,7 +35,12 @@ public sealed class PathResolver(IReadOnlyDictionary<string, string?>? environme
|
||||
public ResolvedLauncherPaths Resolve(LauncherPathVariables variables, IEnumerable<string>? required = null)
|
||||
{
|
||||
var resolved = new Dictionary<string, string?>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var name in variables.Values.Keys) resolved[name] = ResolveVariable(name, variables, resolved, []);
|
||||
// Explicit null values represent optional paths (for example the Apply
|
||||
// permit during Preview). They are retained as null rather than being
|
||||
// treated as an unknown variable; required values are still enforced
|
||||
// below.
|
||||
foreach (var name in variables.Values.Keys)
|
||||
resolved[name] = variables[name] is null ? null : ResolveVariable(name, variables, resolved, []);
|
||||
foreach (var name in resolved.Keys.ToArray())
|
||||
if (resolved[name] is { } value && value.StartsWith("A:\\", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user