Changeset 36 in code for trunk/cli/publish.ml
- Timestamp:
- Nov 25, 2022, 4:27:51 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cli/publish.ml
r27 r36 6 6 ["htm,atom", "public_html/"; "gmi,gmi-atom", "public_gemini/"; "", "public_gopher/"] 7 7 8 let wizard () = 9 print_endline "No txt.conf found. It's required for the repository name & id. Create one? (y/N)"; 10 match input_line stdin with 11 |"y"-> 12 let title = 13 print_endline "Title for repository: "; 14 input_line stdin in 15 let authors = 16 print_endline "Authors (format: name <name@email> <http://website>): "; 17 input_line stdin in 18 Logarion.File_store.file "txt.conf" 19 (Printf.sprintf "Id: %s\nTitle: %s\nAuthors: %s\n" (Logarion.Id.generate ()) title authors); 20 Logarion.File_store.of_kv_file () 21 | _ -> print_endline "Create a txt.conf and run publish again"; exit 1 22 8 23 open Logarion 9 24 let publish pubdir ids = 10 let kv = Logarion.File_store.of_kv_file () in 25 let kv = 26 match Logarion.File_store.of_kv_file () 27 with x when x = Logarion.Store.KV.empty -> wizard () | x -> x in 11 28 let predicate t = List.mem t.Text.id ids in 12 29 let pubdir_source, pubdir = match pubdir with Some d -> "--pubdir ", d | None -> … … 16 33 let targets = targets pubdir in 17 34 if targets = [] then 18 Printf.eprintf "No target directories in %s='%s'\n" pubdir_source pubdir 35 Printf.eprintf "No target directories in %s='%s' (for example %s)\n" 36 pubdir_source pubdir (Filename.concat pubdir "public_html") 19 37 else begin 20 38 let pub_dirs = List.map (fun x -> snd x) targets in
Note:
See TracChangeset
for help on using the changeset viewer.