Skip to content

Commit

Permalink
Improve error handling. Always close channel. Tweak best effort guess
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed Sep 26, 2023
1 parent ed3090b commit bdb8df0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions linkspath/gen_linkspath.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
module C = Configurator.V1

let is_git_repository () =
try
let ic = Unix.open_process_in "git rev-parse --is-inside-work-tree 2> /dev/null" in
let ans = String.equal "true" (input_line ic) in
match Unix.close_process_in ic with
| Unix.WEXITED 0 -> ans
| _ -> false
with End_of_file -> false
let ic = Unix.open_process_in "git rev-parse --is-inside-work-tree 2> /dev/null" in
let ans =
try String.equal "true" (input_line ic) with _ -> false
in
match Unix.close_process_in ic with
| Unix.WEXITED 0 -> ans
| _ -> false

let check_opam =
Option.is_some (Sys.getenv_opt "LINKS_BUILT_BY_OPAM")
Expand Down Expand Up @@ -55,7 +55,7 @@ let _ =
let cwd = Sys.getcwd () in
let config = "None" in
let paths =
List.map (Filename.concat cwd) ["lib/js"; "examples"; "lib/stdlib"; "prelude.links"]
List.map (Filename.concat cwd) ["../lib/js"; "../examples"; "../lib/stdlib"; "../prelude.links"]
in
config :: paths
in
Expand Down

0 comments on commit bdb8df0

Please sign in to comment.