Txt pull puts peer texts in $txtdir/peers
This commit is contained in:
parent
7ce741cf56
commit
e471b6c9c2
2 changed files with 5 additions and 7 deletions
|
@ -3,11 +3,9 @@ type item_t = t list
|
|||
type record_t = Text.t * item_t
|
||||
|
||||
let extension = ".txt"
|
||||
let def_dir () =
|
||||
let share = Sys.getenv "HOME" ^ "/.local/share/texts/" in
|
||||
try Sys.getenv "txtdir" with Not_found ->
|
||||
match Sys.is_directory share with
|
||||
| true -> share
|
||||
let def_dir () = try Sys.getenv "txtdir" with Not_found ->
|
||||
let share = Filename.concat (Sys.getenv "HOME") ".local/share/texts/" in
|
||||
match Sys.is_directory share with true -> share
|
||||
| false | exception (Sys_error _) -> "."
|
||||
|
||||
let to_string f =
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
let text_dir = Filename.concat (Sys.getenv "HOME") ".local/share/texts"
|
||||
let text_dir = Filename.concat (File_store.def_dir ()) "peers"
|
||||
|
||||
let fold fn init = match Sys.readdir text_dir with
|
||||
| exception (Sys_error msg) -> prerr_endline msg
|
||||
|
|
Loading…
Reference in a new issue