story: make |story-{set,remove} use $cash instead of $case

This commit is contained in:
Yaseen 2022-02-18 17:49:17 -05:00
parent b616f48169
commit 4b04da5a9a
2 changed files with 16 additions and 10 deletions

View File

@ -5,7 +5,7 @@
/- *story
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[[syd=desk ~] cas=case prz=prose ~]
[[syd=desk ~] cas=cash prz=prose ~]
==
::
:: XX: story set and story init both have desk and case as optional.
@ -15,7 +15,12 @@
:: leaning towards no, and potentially even making the case non-optional
=/ our p.bec
=? cas =(*case cas) da+now :: use current commit if cas not provided
=/ tak .^(tako:clay %cs /(scot %p our)/[syd]/(scot cas)/tako/~)
=/ tak
?: ?=([%tako tako:clay] cas)
p.cas
.^(tako:clay %cs /(scot %p our)/[desk]/(scot cas)/tako/~)
::
=/ tale=story .^(story %cx /(scot %p our)/[syd]/(scot %da now)/story)
=. tale
?: =(*prose prz)

View File

@ -5,19 +5,20 @@
/- *story
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[[=prose ~] =desk cas=case ~]
[[=prose ~] =desk cas=cash ~]
==
::
::
::
=/ our p.bec
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist."
helm-pass+[%d %noop ~]
=? cas =(*case cas) da+now :: use current commit if cas not provided
=/ tak .^(tako:clay %cs /(scot %p our)/[desk]/(scot cas)/tako/~)
:: TODO case existence check
=/ tak
?: ?=([%tako tako:clay] cas)
p.cas
.^(tako:clay %cs /(scot %p our)/[desk]/(scot cas)/tako/~)
::
=/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story)
=. tale (~(put ju tale) tak prose)
:- %helm-pass