loader.lua: re-arrange to load local.lua *after* config loading

The major problem with the current ordering is that loader.conf may contain
all of the magic we need to actually setup the console, so loading local.lua
prior to that can make it excessively difficult and annoying to debug
(whoops, sorry Ravi & Warner).

The new ordering has some implications, but I suspect they are a non-issue.
The first is that it's no longer possible for the local module to inject any
logic prior to loading config -- I suspect no one has relied on this. The
second implication is that the config.loaded hook is now useless, as the
local module will always be included after that hook would have fired.

For config.loaded, I will opt to leave it in, just in case we add an early
point for local lua to get injected or in case one wants to schedule some
deferred logic in a custom loader.lua. The overhead of having it if no hooks
will be invoked is relatively minimal.

Diagnosed by:	imp
Reported by:	imp, rpokala (most likely)
MFC after:	3 days
This commit is contained in:
Kyle Evans 2020-01-25 03:02:45 +00:00
parent d35738c38d
commit 59ba5b1dc2

View File

@ -42,14 +42,14 @@ local password = require("password")
-- need it.
local menu
try_include("local")
config.load()
-- Our console may have been setup for a different color scheme before we get
-- here, so make sure we set the default.
if color.isEnabled() then
printc(color.default())
end
try_include("local")
if not core.isMenuSkipped() then
menu = require("menu")
end