Add config validation hook
parent
c684812638
commit
362a51f178
@ -0,0 +1,27 @@
|
||||
local silo = require 'silo'
|
||||
|
||||
local function missing(name)
|
||||
error("config value for `" .. name .. "` is missing")
|
||||
end
|
||||
|
||||
local function before_apply_all()
|
||||
local cfg = silo.config
|
||||
|
||||
if not cfg.environment then
|
||||
missing('environment')
|
||||
end
|
||||
if not cfg.username then
|
||||
missing('username')
|
||||
end
|
||||
if not cfg.wezterm.font_size then
|
||||
missing('wezterm.font_size')
|
||||
end
|
||||
if not cfg.modules then
|
||||
missing('modules')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
before_apply_all = before_apply_all
|
||||
}
|
Loading…
Reference in New Issue