Merge pull request #2850 from urbit/ixv/publish-metadata-noop

publish: allow crash case to no-op instead
This commit is contained in:
ixv 2020-05-04 22:06:27 -07:00 committed by GitHub
commit c328e548d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,9 +331,16 @@
?+ mar (on-poke:def mar vas) ?+ mar (on-poke:def mar vas)
:: ::
%noun %noun
?: =(q.vas %flush-limbo) ?+ q.vas
[~ this(limbo [~ ~])] [~ this]
[~ this] ::
%flush-limbo [~ this(limbo [~ ~])]
::
%reset-warp
=/ rav [%sing %t [%da now.bol] /app/publish/notebooks]
:_ this
[%pass /read/paths %arvo %c %warp our.bol q.byk.bol `rav]~
==
:: ::
%handle-http-request %handle-http-request
=+ !<([id=@ta req=inbound-request:eyre] vas) =+ !<([id=@ta req=inbound-request:eyre] vas)
@ -1857,8 +1864,9 @@
:: ::
%remove %remove
=/ app-path [(scot %p author.del) /[book.del]] =/ app-path [(scot %p author.del) /[book.del]]
=/ group-path (group-from-book app-path) =/ group-path=(unit path) (group-from-book app-path)
[(metadata-poke [%remove group-path [%publish app-path]])]~ ?~ group-path ~
[(metadata-poke [%remove u.group-path [%publish app-path]])]~
== ==
:: ::
++ add ++ add
@ -1884,13 +1892,12 @@
:: ::
++ group-from-book ++ group-from-book
|= app-path=path |= app-path=path
^- path ^- (unit path)
?. .^(? %gu (scot %p our.bol) %metadata-store (scot %da now.bol) ~) ?. .^(? %gu (scot %p our.bol) %metadata-store (scot %da now.bol) ~)
?: ?=([@ ^] app-path) ?: ?=([@ ^] app-path)
~& [%assuming-ported-legacy-publish app-path] ~& [%assuming-ported-legacy-publish app-path]
[%'~' app-path] `[%'~' app-path]
~| [%weird-publish app-path] ~&([%weird-publish app-path] ~)
!!
=/ resource-indices =/ resource-indices
.^ (jug resource group-path) .^ (jug resource group-path)
%gy %gy
@ -1899,8 +1906,12 @@
(scot %da now.bol) (scot %da now.bol)
/resource-indices /resource-indices
== ==
=/ groups=(set path) (~(got by resource-indices) [%publish app-path]) =/ groups=(unit (set path))
(snag 0 ~(tap in groups)) (~(get by resource-indices) [%publish app-path])
?~ groups ~
=/ group-paths ~(tap in u.groups)
?~ group-paths ~
`i.group-paths
-- --
:: ::
++ metadata-hook-poke ++ metadata-hook-poke