shrub/pkg/arvo/ted/runtime-version.hoon

40 lines
898 B
Plaintext
Raw Normal View History

2023-06-06 15:46:44 +03:00
/- spider
/+ strandio
=>
|%
+$ vere-update [cur=vere next=(unit vere)]
::
++ parse-current-pace
|= current=vere
^- @t
(snag 1 rev.current)
::
2023-06-06 15:46:44 +03:00
++ parse-current-version
|= current=vere
^- @t
(slav %ta (rear rev.current))
2023-06-06 15:46:44 +03:00
::
++ is-equal-version
|= [latest=@t current=vere]
=(latest (parse-current-version current))
--
=, strand=strand:spider
^- thread:spider
|= arg=vase
=/ m (strand ,vase)
;< =bowl:spider bind:m get-bowl:strandio
=/ cur=vere .^(vere %$ /(scot %p our.bowl)//(scot %da now.bowl)/zen/ver)
=/ pace=tape
?: =('once' (parse-current-pace cur))
"live"
(trip (parse-current-pace cur))
;< latest=cord bind:m
(fetch-cord:strandio "https://bootstrap.urbit.org/vere/{pace}/last")
2023-06-06 15:46:44 +03:00
=/ =vere-update
?: (is-equal-version latest cur)
[cur ~]
=| next=vere
[cur `next(rev /vere/(crip pace)/(scot %ta latest))]
2023-06-06 15:46:44 +03:00
%- pure:m
!>(vere-update)