mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-22 06:11:31 +03:00
story: make |story-{set,remove} use $cash instead of $case
This commit is contained in:
parent
b616f48169
commit
4b04da5a9a
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user