load user clink

This commit is contained in:
Dax T. Games 2018-03-24 08:03:28 -05:00
parent bcf8527f74
commit 864f778099
2 changed files with 23 additions and 0 deletions

1
.gitignore vendored
View File

@ -14,6 +14,7 @@ build/
Version v* Version v*
*.bak *.bak
config/user-* config/user-*
config/*.lua
config/settings config/settings
config/aliases config/aliases
config/profile.d config/profile.d

22
vendor/clink.lua vendored
View File

@ -351,3 +351,25 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
dofile(filename) dofile(filename)
end end
end end
local cmder_config_dir = clink.get_env('CMDER_ROOT')..'/config/'
for _,lua_module in ipairs(clink.find_files(cmder_config_dir..'*.lua')) do
-- Skip files that starts with _. This could be useful if some files should be ignored
if not string.match(lua_module, '^_.*') then
local filename = cmder_config_dir..lua_module
-- use dofile instead of require because require caches loaded modules
-- so config reloading using Alt-Q won't reload updated modules.
dofile(filename)
end
end
local cmder_user_config_dir = clink.get_env('CMDER_USER_CONFIG')..'/'
for _,lua_module in ipairs(clink.find_files(cmder_user_config_dir..'*.lua')) do
-- Skip files that starts with _. This could be useful if some files should be ignored
if not string.match(lua_module, '^_.*') then
local filename = cmder_user_config_dir..lua_module
-- use dofile instead of require because require caches loaded modules
-- so config reloading using Alt-Q won't reload updated modules.
dofile(filename)
end
end