source: code/trunk/init/init.ml@ 72

Last change on this file since 72 was 72, checked in by yakumo.izuru, 8 months ago

Reimplemented txt-init in OCaml

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 903 bytes
Line 
1open Logarion
2let init_repo =
3 print_endline "No txt.conf found";
4 print_endline "It's required for the repository name and id.";
5 print_endline "Create one? (y/n)";
6 match input_line stdin with
7 |"y"->
8 let title =
9 print_endline "Title for repository: ";
10 input_line stdin in
11 let authors =
12 print_endline "Authors (format: name <name@email> <http://website>): ";
13 input_line stdin in
14 Logarion.File_store.file "txt.conf"
15 (Printf.sprintf "Id:%s\nTitle: %s\nAuthors: %s\n" (Logarion.Id.generate ()) title authors);
16 Logarion.File_store.of_kv_file ()
17 | _ ->
18 print_endline "Aborting..."; exit 1
Note: See TracBrowser for help on using the repository browser.