From 4b04da5a9aa2738ac359f779ee47e3bcca6cc42b Mon Sep 17 00:00:00 2001 From: Yaseen Date: Fri, 18 Feb 2022 17:49:17 -0500 Subject: [PATCH] story: make |story-{set,remove} use $cash instead of $case --- pkg/arvo/gen/hood/story-remove.hoon | 9 +++++++-- pkg/arvo/gen/hood/story-set.hoon | 17 +++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pkg/arvo/gen/hood/story-remove.hoon b/pkg/arvo/gen/hood/story-remove.hoon index 400aeb6df..da8c268b4 100644 --- a/pkg/arvo/gen/hood/story-remove.hoon +++ b/pkg/arvo/gen/hood/story-remove.hoon @@ -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) diff --git a/pkg/arvo/gen/hood/story-set.hoon b/pkg/arvo/gen/hood/story-set.hoon index 30c909505..61c93b128 100644 --- a/pkg/arvo/gen/hood/story-set.hoon +++ b/pkg/arvo/gen/hood/story-set.hoon @@ -5,20 +5,21 @@ /- *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 {} 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/~) -=/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story) -=. tale (~(put ju tale) tak prose) +:: 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 [%c [%info desk %& [/story %ins story+!>(tale)]~]] \ No newline at end of file