mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-11 00:39:08 +08:00
load user clink
This commit is contained in:
parent
bcf8527f74
commit
864f778099
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,6 +14,7 @@ build/
|
||||
Version v*
|
||||
*.bak
|
||||
config/user-*
|
||||
config/*.lua
|
||||
config/settings
|
||||
config/aliases
|
||||
config/profile.d
|
||||
|
22
vendor/clink.lua
vendored
22
vendor/clink.lua
vendored
@ -351,3 +351,25 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
||||
dofile(filename)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user