We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
executable
1 parent 2cdc2fa commit 472e40aCopy full SHA for 472e40a
1 file changed
FindExecutable/FindExecutable.cs
@@ -70,6 +70,15 @@ public static class FindExecutable
70
bool includeBaseDirectory = false,
71
IEnumerable<string>? additionalPaths = null)
72
{
73
+ if (Path.IsPathRooted(executable))
74
+ {
75
+ if (File.Exists(executable) && IsExecutable(executable))
76
77
+ return executable;
78
+ }
79
+ return null;
80
81
+
82
IEnumerable<string> paths = Environment.GetEnvironmentVariable("PATH")?.Split(Path.PathSeparator) ?? Array.Empty<string>();
83
if (includeCurrentDirectory)
84
0 commit comments