Add repository owner as author name when using create command
This commit is contained in:
parent
c2286d0772
commit
328e6da91e
@ -73,10 +73,17 @@ let create_term =
|
|||||||
Arg.(value & pos 0 string "" & info [] ~docv:"TITLE" ~doc:"Title for new article")
|
Arg.(value & pos 0 string "" & info [] ~docv:"TITLE" ~doc:"Title for new article")
|
||||||
in
|
in
|
||||||
let f title =
|
let f title =
|
||||||
let repo = (conf ()).C.repository in
|
let conf = conf () in
|
||||||
let t = match title with "" -> "Draft" | _ -> title in
|
let t = match title with "" -> "Draft" | _ -> title in
|
||||||
let note = Note.({ (blank ()) with meta = { (Meta.blank ()) with Meta.title = t }}) in
|
let note =
|
||||||
File.Lwt.with_note (File.store repo) note
|
let meta =
|
||||||
|
let open Meta in
|
||||||
|
let author = Author.({ name = conf.C.owner; email = Email.of_string conf.C.email }) in
|
||||||
|
{ (blank ()) with title = t; author }
|
||||||
|
in
|
||||||
|
Note.({ (blank ()) with meta })
|
||||||
|
in
|
||||||
|
File.Lwt.with_note (File.store conf.C.repository) note
|
||||||
|> Lwt_main.run
|
|> Lwt_main.run
|
||||||
|> ignore
|
|> ignore
|
||||||
in
|
in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user