mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
story: check for storyfile existence and use case from beak where appl.
This commit is contained in:
parent
4b04da5a9a
commit
05784fcee3
@ -7,8 +7,6 @@
|
||||
|= $: [now=@da eny=@uvJ bec=beak]
|
||||
[[~] =desk overwrite=_| ~]
|
||||
==
|
||||
::
|
||||
::
|
||||
=/ 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)
|
||||
|
@ -14,14 +14,16 @@
|
||||
:: should we allow a bare `|story-remove` to remove the last commit message on the current desk?
|
||||
:: 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
|
||||
|
||||
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
|
||||
:: 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)/[syd]/(scot %da now)/story)
|
||||
=/ pax /(scot %p our)/[desk]/(scot cas)/story
|
||||
?. .^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~]
|
||||
=/ tale=story .^(story %cx pax)
|
||||
=. tale
|
||||
?: =(*prose prz)
|
||||
(~(del by tale) tak)
|
||||
|
@ -9,17 +9,19 @@
|
||||
==
|
||||
=/ our p.bec
|
||||
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
|
||||
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
|
||||
?: !(~(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
|
||||
:: 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)
|
||||
=/ pax /(scot %p our)/[desk]/(scot cas)/story
|
||||
?. .^(? %cu pax) tang+['Error: No story file found. Please use |story-init to create one.' ~]
|
||||
=/ 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)]~]]
|
@ -9,8 +9,11 @@
|
||||
==
|
||||
=/ our p.bec
|
||||
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
|
||||
=/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story)
|
||||
=/ story-to-mime .^($-(story mime) %cf /(scot %p our)/[desk]/(scot %da now)/story/mime)
|
||||
=/ 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.' ~]
|
||||
=/ 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)
|
||||
=/ tale-text `@t`q.q.tale-mime
|
||||
:- %tang
|
||||
|
@ -11,12 +11,14 @@
|
||||
|^
|
||||
=/ our p.bec
|
||||
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
|
||||
=/ cas=case da+now
|
||||
=/ tale .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story)
|
||||
=/ 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.' ~]
|
||||
=/ 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))
|
||||
:- %tang
|
||||
(story-log [our desk] current-yaki tale)
|
||||
(story-log [our desk cas] current-yaki tale)
|
||||
::::
|
||||
:: Remarks:
|
||||
::
|
||||
@ -25,9 +27,8 @@
|
||||
:: 2. the inner loop, `ancestor-loop`, which threads left-to-right on reverse-ancestors
|
||||
::::
|
||||
++ story-log
|
||||
|= [[our=ship syd=^desk] current-commit=yaki:clay tale=story]
|
||||
|= [[our=ship syd=^desk cas=case] current-commit=yaki:clay tale=story]
|
||||
^- tang
|
||||
=/ cas=case da+now
|
||||
::
|
||||
%- flop :: least-recent-first -> most-recent-first
|
||||
%- head :: result from state
|
||||
@ -100,6 +101,7 @@
|
||||
=. state ancestor-loop(reverse-ancestors t.reverse-ancestors) :: traverse rightwards
|
||||
state
|
||||
==
|
||||
::
|
||||
++ msg-from-commit
|
||||
|= [commit=yaki:clay tale=story]
|
||||
^- (unit cord)
|
||||
@ -111,5 +113,4 @@
|
||||
(tako-to-text:lib r.commit)
|
||||
(proses-to-text:lib u.proses)
|
||||
==
|
||||
::
|
||||
--
|
Loading…
Reference in New Issue
Block a user