Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Nov 2, 2023
1 parent 25b4b13 commit 6a2b7ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/opamStd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,9 @@ module OpamSys = struct
else
fun x -> x

let chop_exe_suffix name =
Option.default name (Filename.chop_suffix_opt name ~suffix:".exe")

let windows_process_ancestry = Lazy.from_fun OpamStubs.getProcessAncestry

type shell_choice = Accept of shell
Expand All @@ -1085,10 +1088,11 @@ module OpamSys = struct
| "pwsh.exe" -> Some (Accept (SH_pwsh Powershell_pwsh))
| "cmd.exe" -> Some (Accept SH_cmd)
| "env.exe" -> Some (Accept SH_sh)
| "" -> None
| name ->
Option.map
(fun shell -> Accept shell)
(shell_of_string (Filename.chop_suffix name ".exe"))
(shell_of_string (chop_exe_suffix name ".exe"))
in
lazy (
let lazy ancestors = windows_process_ancestry in
Expand Down
3 changes: 3 additions & 0 deletions src/core/opamStd.mli
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ module Sys : sig
(** Append .exe (only if missing) to executable filenames on Windows *)
val executable_name : string -> string

(** Remove .exe (if present) from an executable filename on Windows *)
val chop_exe_suffix : string -> string

(** The different families of shells we know about *)
type powershell_host = Powershell_pwsh | Powershell
type shell = SH_sh | SH_bash | SH_zsh | SH_csh | SH_fish
Expand Down

0 comments on commit 6a2b7ce

Please sign in to comment.