Skip to content

Commit

Permalink
[package] Workaround realpath failing with non-existing files
Browse files Browse the repository at this point in the history
Fixes Deducteam#432 , introduced in Deducteam#289

This whole code needs more investigation as the logic seems quite
strange, in particular I think the core of LP should not mess with
filesystem low-level details, but hoping for a quick fix.
  • Loading branch information
ejgallego committed Nov 11, 2020
1 parent bb61c65 commit 53cf9b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/package.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ let read : file_path -> config_data = fun fname ->
[Sys_error] is raised. Note that [fname] is first normalized with a call
to [Filename.realpath]. *)
let find_config : file_path -> file_path option = fun fname ->
let fname = Filename.realpath fname in
(* workaround #432 , this whole code should be reworked tho *)
let fname =
if Sys.file_exists fname
then Filename.realpath fname
else fname
in
let fname =
if Sys.is_directory fname then fname else Filename.dirname fname
in
Expand Down

0 comments on commit 53cf9b8

Please sign in to comment.