added back up module store for non lfs support

This commit is contained in:
Luke Miller 2022-06-08 16:52:46 -04:00
parent 1f88981112
commit 3824399f33
2 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,9 @@
local lfs = require "lfs"
local lfs
-- checks if lua file system is installed
local using_lfs = pcall(function() lfs = require "lfs" end)
-- switches to legacy module loading if lfs is not available
if using_lfs then
-- loads file names to ignore into a table
function fetch_ignores(module_path)
@ -47,4 +52,8 @@ modpol.load_modules = function(module_path)
end
end
print(loaded .. " modules loaded (" .. ignored .. " ignored)")
end
else
dofile (modpol.topdir .. "/store/sotre-modules-legacy.lua")
end