From c02f59818e4b3ef0a51d40729ccdaa7dbfe69551 Mon Sep 17 00:00:00 2001 From: Yaseen Date: Fri, 18 Feb 2022 18:51:37 -0500 Subject: [PATCH] story: fix generator bugs --- pkg/arvo/gen/hood/story-remove.hoon | 10 ++++++---- pkg/arvo/gen/hood/story-set.hoon | 4 +++- pkg/arvo/gen/story-list.hoon | 2 +- pkg/arvo/gen/story-log.hoon | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pkg/arvo/gen/hood/story-remove.hoon b/pkg/arvo/gen/hood/story-remove.hoon index 729d07e535..c76e0f6d89 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=cash prz=prose ~] + [[=desk ~] cas=cash prz=prose ~] == :: :: XX: story set and story init both have desk and case as optional. @@ -21,12 +21,14 @@ p.cas .^(tako:clay %cs /(scot %p our)/[desk]/(scot cas)/tako/~) :: -=/ pax /(scot %p our)/[desk]/(scot cas)/story -?. .^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~] +=/ pax /(scot %p our)/[desk]/(scot %da now)/story +?: !.^(? %cu pax) + ~& >> "Error: desk {} does not exist." + helm-pass+[%d %noop ~] =/ tale=story .^(story %cx pax) =. tale ?: =(*prose prz) (~(del by tale) tak) (~(del ju tale) tak prz) :- %helm-pass -[%c [%info syd %& [/story %ins story+!>(tale)]~]] \ No newline at end of file +[%c [%info desk %& [/story %ins story+!>(tale)]~]] \ No newline at end of file diff --git a/pkg/arvo/gen/hood/story-set.hoon b/pkg/arvo/gen/hood/story-set.hoon index 12c06a7b55..d21bfccd9c 100644 --- a/pkg/arvo/gen/hood/story-set.hoon +++ b/pkg/arvo/gen/hood/story-set.hoon @@ -20,7 +20,9 @@ .^(tako:clay %cs /(scot %p our)/[desk]/(scot cas)/tako/~) :: =/ pax /(scot %p our)/[desk]/(scot cas)/story -?. .^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~] +?: !.^(? %cu pax) + ~& >> "Error: desk {} does not exist." + helm-pass+[%d %noop ~] =/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story) =. tale (~(put ju tale) tak prose) :- %helm-pass diff --git a/pkg/arvo/gen/story-list.hoon b/pkg/arvo/gen/story-list.hoon index 219c420314..378cb6b038 100644 --- a/pkg/arvo/gen/story-list.hoon +++ b/pkg/arvo/gen/story-list.hoon @@ -11,7 +11,7 @@ =? desk =(*^desk desk) q.bec :: use current desk if user didn't provide =/ cas r.bec :: use case from beak =/ pax /(scot %p our)/[desk]/(scot cas)/story -?. .^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~] +?: !.^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~] =/ tale=story .^(story %cx pax) =/ story-to-mime .^($-(story mime) %cf /(scot %p our)/[desk]/(scot cas)/story/mime) =/ tale-mime (story-to-mime tale) diff --git a/pkg/arvo/gen/story-log.hoon b/pkg/arvo/gen/story-log.hoon index f421c452ad..a905981763 100644 --- a/pkg/arvo/gen/story-log.hoon +++ b/pkg/arvo/gen/story-log.hoon @@ -13,7 +13,7 @@ =? desk =(*^desk desk) q.bec :: use current desk if user didn't provide =/ cas=case r.bec :: use case from beak =/ pax /(scot %p our)/[desk]/(scot cas)/story -?. .^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~] +?: !.^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~] =/ tale .^(story %cx pax) =/ current-tako .^(tako:clay %cs /(scot %p our)/[desk]/(scot cas)/tako/~) =/ current-yaki .^(yaki:clay %cs /(scot %p our)/[desk]/(scot cas)/yaki/(scot %uv current-tako))