From e69e7f9b82a5bd002412a5f684d5a52c1997457b Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 1 Sep 2018 14:59:40 -0400 Subject: [PATCH] run user lua afer cmder lua --- launcher/src/CmderLauncher.cpp | 2 +- vendor/clink.lua | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index bfb7918..9f0a275 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -363,7 +363,7 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName) { HKEY root = GetRootKey(opt); HKEY cmderKey; - // FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); + FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL)); RegDeleteKeyEx(root, keyBaseName, KEY_ALL_ACCESS, NULL); RegCloseKey(cmderKey); diff --git a/vendor/clink.lua b/vendor/clink.lua index 35acb73..9db28fc 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -370,13 +370,15 @@ for _,lua_module in ipairs(clink.find_files(cmder_config_dir..'*.lua')) do 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 +if clink.get_env('CMDER_USER_CONFIG') then + 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 end