soto: run +on-load migration once

This commit is contained in:
Liam Fitzgerald 2020-06-18 21:47:44 +10:00
parent 08b4a47589
commit 0ac7a75896

View File

@ -6,8 +6,14 @@
/+ *soto, default-agent
|%
+$ card card:agent:gall
+$ state-zero ~
::
+$ versioned-state
$@ state-null
state-zero
::
+$ state-null ~
::
+$ state-zero [%0 ~]
--
=| state-zero
=* state -
@ -18,12 +24,22 @@
sc ~(. soto-core bol)
def ~(. (default-agent this %|) bol)
::
++ on-init [~ this]
++ on-init
:_ this
:_ ~
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~dojo' /app/landscape %.n])
==
++ on-save !>(state)
::
++ on-load
|= old=vase
:_ this(state !<(state-zero old))
|= old-vase=vase
=/ old
!<(versioned-state old-vase)
?^ old
[~ this(state old)]
:_ this(state [%0 ~])
:~ [%pass /bind/soto %arvo %e %disconnect [~ /'~dojo']]
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action