@@ -32,7 +32,6 @@ setmetatable(Changes, require('__stdlib__/stdlib/core'))
3232 old_version :: string: Old version of the mod. May be nil if the mod wasn't previously present (i.e. it was just added).
3333 new_version :: string: New version of the mod. May be nil if the mod is no longer present (i.e. it was just removed).
3434--]]
35-
3635local table = require (' __stdlib__/stdlib/utils/table' )
3736
3837local map_changes = {
@@ -106,18 +105,16 @@ function Changes.on_configuration_changed(event)
106105end
107106
108107function Changes .on_mod_changed (this_mod_changes )
109- if Changes .mod_versions then
110- global ._changes = global ._changes or {}
108+ global ._changes = global ._changes or {}
111109
112- local old = this_mod_changes .old_version
113- if old then -- Find the last installed version
114- for _ , path in pairs (Changes .versions ) do
115- for ver , func in pairs (path ) do
116- if not global ._changes [ver ] then
117- run_if_exists (func )
118- global ._changes [ver ] = old
119- log (' Migration completed for version ' .. ver )
120- end
110+ local old = this_mod_changes .old_version
111+ if old then -- Find the last installed version
112+ for _ , path in pairs (Changes .mod_versions ) do
113+ for ver , func in pairs (path ) do
114+ if not global ._changes [ver ] then
115+ run_if_exists (func )
116+ global ._changes [ver ] = old
117+ log (' Migration completed for version ' .. ver )
121118 end
122119 end
123120 end
0 commit comments