Merge pull request #6555 from urbit/story-fix

Fix story (commit message system).
This commit is contained in:
Ted Blackman 2023-05-16 11:30:57 -04:00 committed by GitHub
commit 0760248300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 17 deletions

View File

@ -10,14 +10,11 @@
=/ our p.bec =/ our p.bec
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide =? 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) ?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist." helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
helm-pass+[%d %noop ~]
=/ existing-story .^(? %cu /(scot %p our)/[desk]/(scot %da now)/story) =/ existing-story .^(? %cu /(scot %p our)/[desk]/(scot %da now)/story)
?: ?&(existing-story !overwrite) ?: ?&(existing-story !overwrite)
~& >> "Error: /{(trip (slav %tas desk))}/story already exists." :- %helm-pass
~& >> "To forcibly overwrite, use `=overwrite %.y`" [%d %flog %text "Error: /{(trip (slav %tas desk))}/story already exists. To forcibly overwrite, use `=overwrite %.y`"]
:: XX could use a better way to noop
helm-pass+[%d %noop ~]
=| tale=story =| tale=story
:- %helm-pass :- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]] [%c [%info desk %& [/story %ins story+!>(tale)]~]]

View File

@ -13,8 +13,7 @@
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide =? 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 =? 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) ?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist." helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
helm-pass+[%d %noop ~]
=/ tak=tako:clay =/ tak=tako:clay
?: ?=([%tako tako:clay] cas) ?: ?=([%tako tako:clay] cas)
p.cas p.cas
@ -25,12 +24,11 @@
:: ::
=/ pax /(scot %p our)/[desk]/(scot %da now)/story =/ pax /(scot %p our)/[desk]/(scot %da now)/story
?: !.^(? %cu pax) ?: !.^(? %cu pax)
~& >> "Error: No story file found. Please use |story-init to create one." helm-pass+[%d %flog %text "Error: No story file found. Please use |story-init to create one."]
helm-pass+[%d %noop ~]
=/ tale=story .^(story %cx pax) =/ tale=story .^(story %cx pax)
=. tale =. tale
?: =(*prose prz) ?: =(*prose prz)
(~(del by tale) tak) (~(del by tale) tak)
(~(del ju tale) tak prz) (~(del ju tale) tak prz)
:- %helm-pass :- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]] [%c [%info desk %& [/story %ins story+!>(tale)]~]]

View File

@ -13,8 +13,7 @@
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide =? 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 =? 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) ?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
~& >> "Error: desk {<desk>} does not exist." helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
helm-pass+[%d %noop ~]
=/ tak=tako:clay =/ tak=tako:clay
?: ?=([%tako tako:clay] cas) ?: ?=([%tako tako:clay] cas)
p.cas p.cas
@ -25,10 +24,9 @@
:: ::
=/ pax /(scot %p our)/[desk]/(scot %da now)/story =/ pax /(scot %p our)/[desk]/(scot %da now)/story
?: !.^(? %cu pax) ?: !.^(? %cu pax)
~& >> "Error: No story file found. Please use |story-init to create one." helm-pass+[%d %flog %text "Error: No story file found. Please use |story-init to create one."]
helm-pass+[%d %noop ~]
=/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story) =/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story)
=/ =prose [title ?~(body '' p.body)] =/ =prose [title ?~(body '' p.body)]
=. tale (~(put ju tale) tak prose) =. tale (~(put ju tale) tak prose)
:- %helm-pass :- %helm-pass
[%c [%info desk %& [/story %ins story+!>(tale)]~]] [%c [%info desk %& [/story %ins story+!>(tale)]~]]