File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ let log3 = ref (fun _ -> failwith "My_std.log3 not initialized")
301301
302302let windows_shell = lazy begin
303303 let rec iter = function
304- | [] -> [| " bash.exe " ; " --norc " ; " --noprofile " |]
304+ | [] -> raise Not_found
305305 | hd ::tl ->
306306 let dash = Filename. concat hd " dash.exe" in
307307 if Sys. file_exists dash then [|dash|] else
@@ -312,9 +312,18 @@ let windows_shell = lazy begin
312312 if Sys. file_exists sh then [|sh|] else [|bash ; " --norc" ; " --noprofile" |]
313313 in
314314 let paths = split_quoted (try Sys. getenv " PATH" with Not_found -> " " ) ';' in
315- let res = iter paths in
316- ! log3 (Printf. sprintf " Using shell %s" (Array. to_list res |> String. concat " " ));
317- res
315+ let shell =
316+ try
317+ let path =
318+ List. find (fun path ->
319+ Sys. file_exists (Filename. concat path " cygcheck.exe" )) paths
320+ in
321+ iter [path]
322+ with Not_found ->
323+ (try iter paths with Not_found -> failwith " no posix shell found in PATH" )
324+ in
325+ ! log3 (Printf. sprintf " Using shell %s" (Array. to_list shell |> String. concat " " ));
326+ shell
318327end
319328
320329let prepare_command_for_windows cmd =
You can’t perform that action at this time.
0 commit comments