Skip to content

Commit

Permalink
Fix Windows error in OpamSystem.resolve_command
Browse files Browse the repository at this point in the history
Returns the directory found, instead of the complete command.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
  • Loading branch information
dra27 committed Mar 17, 2018
1 parent 5f4d20b commit 5255239
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ let env_var env var =
makes unqualified commands absolute as a workaround. *)
let resolve_command =
let is_external_cmd name =
let name = forward_to_back name in
OpamStd.String.contains_char name Filename.dir_sep.[0]
in
let check_perms =
Expand Down Expand Up @@ -349,9 +350,9 @@ let resolve_command =
let name =
if Filename.check_suffix name ".exe" then name else name ^ ".exe"
in
OpamStd.List.find_opt (fun path ->
OpamStd.(List.find_opt (fun path ->
check_perms (Filename.concat path name))
path
path |> Option.map (fun path -> Filename.concat path name))
else
let cmd, args = "/bin/sh", ["-c"; Printf.sprintf "command -v %s" name] in
let r =
Expand Down

0 comments on commit 5255239

Please sign in to comment.