File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ let handle_filetype ~filename ~width ~height = function
44 (* empty files *)
55 | "inode/x-empty" -> print_endline " Empty file"
66 (* directories *)
7- | "inode/directory" -> Directory. directory ()
7+ | "inode/directory" -> Directory. directory filename
88 (* archives *)
99 | " application/x-tar" | " application/zip" | " application/x-zip-compressed"
1010 | " application/x-bzip" | " application/x-bzip2" | " application/gzip"
@@ -22,14 +22,14 @@ let handle_filetype ~filename ~width ~height = function
2222 Image. image filename ~width ~height
2323 (* videos *)
2424 | str when String. starts_with ~prefix: " video" str ->
25- FFmpeg . thumbnail filename ~width ~height
25+ Ffmpeg . thumbnail filename ~width ~height
2626 (* everything else, print mime to find new possible filetypes to handle *)
2727 | mime ->
2828 print_endline mime;
2929 Text. text filename
3030
3131let mlpreview ~width ~height ~horizontal ~vertical = function
32- | None -> `Ok (Directory. directory () )
32+ | None -> `Ok (Directory. directory " . " )
3333 | Some filename ->
3434 ignore horizontal;
3535 ignore vertical;
Original file line number Diff line number Diff line change 1- let directory () =
1+ let directory file_name =
22 let stream =
33 Unix. open_process_in
4- @@ " eza -a1F --color=always --group-directories-first --icons=always --git"
4+ @@ Printf. sprintf
5+ " eza -a1F --color=always --group-directories-first --icons=always \
6+ --git \" %s\" "
7+ file_name
58 in
69 print_endline @@ In_channel. input_all stream;
710 In_channel. close stream
Original file line number Diff line number Diff line change 1- val directory : unit -> unit
1+ val directory : string -> unit
22(* * Render directory using eza *)
You can’t perform that action at this time.
0 commit comments