Skip to content

Commit

Permalink
find files with specified extensions as well, fixes #1899
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed Apr 30, 2018
1 parent f609b1c commit 2fb49e3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/Fake.Core.Process/Process.fs
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,12 @@ module Process =
|> fun path ->
// See https://unix.stackexchange.com/questions/280528/is-there-a-unix-equivalent-of-the-windows-environment-variable-pathext
if Environment.isWindows then
Environment.environVarOrDefault "PATHEXT" ".COM;.EXE;.BAT"
|> String.split ';'
|> Seq.tryPick (fun postFix -> tryFindFile path (file + postFix))
match tryFindFile path file with
| Some s -> Some s
| None ->
Environment.environVarOrDefault "PATHEXT" ".COM;.EXE;.BAT"
|> String.split ';'
|> Seq.tryPick (fun postFix -> tryFindFile path (file + postFix))
else tryFindFile path file

/// Returns the AppSettings for the key - Splitted on ;
Expand Down Expand Up @@ -893,4 +896,4 @@ module ProcStartInfoExtensions =
member x.WithVerb name = { x with Verb = name }
#endif
/// When UseShellExecute is true, the fully qualified name of the directory that contains the process to be started. When the UseShellExecute property is false, the working directory for the process to be started. The default is an empty string ("").
member x.WithWorkingDirectory dir = { x with WorkingDirectory = dir }
member x.WithWorkingDirectory dir = { x with WorkingDirectory = dir }

1 comment on commit 2fb49e3

@josiahdj
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll do it, thanks!

Please sign in to comment.