Skip to content

Commit

Permalink
Fix(ReadConsoleOutput): fixed action literal
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardog committed Oct 1, 2022
1 parent 1a9fa02 commit 59af3cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gsudo/Helpers/CommandToRunGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ internal static IList<string> FixCommandExceptions(IList<string> args)
string targetFileName = Path.GetFileName(targetFullPath);

var ExceptionDict = Settings.ExceptionList.Value
.Split(';')
.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Split(new string[] { ":=" }, StringSplitOptions.None))
.ToDictionary(x => x.First(), x => x.Skip(1).FirstOrDefault(), StringComparer.OrdinalIgnoreCase);

Expand Down Expand Up @@ -239,7 +239,7 @@ internal static IList<string> FixCommandExceptions(IList<string> args)
string action = ExceptionDict[targetFileName];

if (string.IsNullOrEmpty(action))
action = $"\"{Environment.GetEnvironmentVariable("COMSPEC")}\" /s /c \"{0}\"";
action = $"\"{Environment.GetEnvironmentVariable("COMSPEC")}\" /s /c \"{{0}}\"";

Logger.Instance.Log($"Found {targetFileName} in Exception List with Action=\"{action}\".", LogLevel.Debug);

Expand Down

0 comments on commit 59af3cc

Please sign in to comment.