shrub/pkg/arvo/gen/hood/story-init.hoon
Yaseen ce0fa85e18 story: generators improvements
- use desk parameter instead of %base everywhere
- formatting clean up
- make |story-remove take a case instead of an aeon
- make desk param optional for story-set and story-log
2022-02-05 22:50:10 -05:00

21 lines
664 B
Plaintext

::
::::
::
/- *story
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[[~] =desk overwrite=_| ~]
==
::
:: Create a story file for a given desk
::
=/ our p.bec
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
=/ existing-story .^(? %cu /(scot %p our)/[desk]/(scot %da now)/story)
?: ?&(existing-story !overwrite)
~& >> "Error: /{(trip (slav %tas desk))}/story already exists. Set the optional parameter `overwrite` to `%.y` to forcibly overwrite."
:: XX could use a better way to noop
helm-pass+[%d %noop ~]
=| tale=story
:- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]]