Improve pubdir parameter reporting

This commit is contained in:
orbifx 2022-11-17 19:22:23 +00:00
parent e62ec11140
commit 45a653d949
1 changed files with 4 additions and 4 deletions

View File

@ -9,13 +9,13 @@ open Logarion
let publish pubdir ids =
let kv = Logarion.File_store.of_kv_file () in
let predicate t = List.mem t.Text.id ids in
let pubdir = match pubdir with Some d -> d | None ->
try Logarion.Store.KV.find "Pubdir" kv with Not_found ->
try Sys.getenv "txtpubdir" with Not_found -> ""
let pubdir_source, pubdir = match pubdir with Some d -> "--pubdir ", d | None ->
try "txt.conf:Pubdir", Logarion.Store.KV.find "Pubdir" kv with Not_found ->
try "$txtpubdir", Sys.getenv "txtpubdir" with Not_found -> "$txtpubdir", ""
in
let targets = targets pubdir in
if targets = [] then
Printf.eprintf "No target directories in $pubdir='%s'\n" pubdir
Printf.eprintf "No target directories in %s='%s'\n" pubdir_source pubdir
else begin
let pub_dirs = List.map (fun x -> snd x) targets in
File_store.iter ~predicate (fun (_t, p) ->