Skip to content

Commit

Permalink
Using temporary workaround for eio windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Jun 30, 2024
1 parent 1aee502 commit ce81e4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bin/BLAKE2B.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let hash_of_file ~env ~path =
let fs = Eio.Stdenv.fs env in
let ctx = ref B.empty in
try
Eio.Path.(with_open_in (fs / File_utils.fix_path_for_eio path))
Eio.Path.(with_open_in (fst fs, File_utils.fix_path_for_eio path))
(fun flow ->
match
Eio.Buf_read.parse ~max_size:Params.hash_chunk_size
Expand Down
15 changes: 7 additions & 8 deletions bin/document.ml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,11 @@ let save_index ~env ~hash index : (unit, string) result =
| Some cache_dir -> (
let fs = Eio.Stdenv.fs env in
let path =
Eio.Path.(
fs /
File_utils.fix_path_for_eio
(Filename.concat
cache_dir
(Fmt.str "%s%s" hash Params.index_file_ext))
(fst fs,
File_utils.fix_path_for_eio
(Filename.concat
cache_dir
(Fmt.str "%s%s" hash Params.index_file_ext))
)
in
let json = Index.to_json index in
Expand All @@ -150,7 +149,7 @@ let find_index ~env ~hash : Index.t option =
|> File_utils.fix_path_for_eio
in
let path =
Eio.Path.(fs / path_str)
(fst fs, path_str)
in
refresh_modification_time ~path:path_str;
let json = Yojson.Safe.from_string (Eio.Path.load path) in
Expand All @@ -163,7 +162,7 @@ module Of_path = struct
let text ~env pool search_mode path : (t, string) result =
let fs = Eio.Stdenv.fs env in
try
Eio.Path.(with_lines (fs / path))
Eio.Path.(with_lines (fst fs, File_utils.fix_path_for_eio path))
(fun lines ->
Ok (parse_lines pool search_mode ~path lines)
)
Expand Down
2 changes: 1 addition & 1 deletion bin/proc_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let run_in_background (cmd : string) =
let run_return_stdout ~proc_mgr ~fs (cmd : string list) : string list option =
Eio.Path.(with_open_out
~create:`Never
(fs / (if Sys.win32 then "nul" else "/dev/null")))
(if Sys.win32 then (fst fs, "nul") else (fs / "/dev/null")))
(fun stderr ->
let output =
try
Expand Down

0 comments on commit ce81e4b

Please sign in to comment.