Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize how clink settings are loaded #794

Merged
merged 2 commits into from
Feb 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions config/settings

This file was deleted.

23 changes: 14 additions & 9 deletions vendor/cmder.lua → vendor/clink.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
-- default script for clink, called by init.bat when injecting clink

-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts


-- At first, load the original clink.lua file
-- this is needed as we set the script path to this dir and therefore the original
-- clink.lua is not loaded.
local clink_lua_file = clink.get_env('CMDER_ROOT')..'\\vendor\\clink\\clink.lua'
dofile(clink_lua_file)

-- now add our own things...

function lambda_prompt_filter()
clink.prompt.value = string.gsub(clink.prompt.value, "{lamb}", "λ")
end
Expand Down Expand Up @@ -190,12 +204,3 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
end
end

-- now do the same for all lua files in config which do not start with '_'
local user_config_dir = clink.get_env('CMDER_ROOT')..'\\config\\'
for _,lua_module in ipairs(clink.find_files(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 = user_config_dir..lua_module
dofile(filename)
end
end
8 changes: 7 additions & 1 deletion vendor/init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@
set architecture=64
)

:: Tell the user about the clink config files...
@if not exist "%CMDER_ROOT%\config\settings" (
echo Generating clink initial settings in %CMDER_ROOT%\config\settings
echo Additional *.lua files in %CMDER_ROOT%\config are loaded on startup.
)

:: Run clink
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\vendor"
@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"

:: Prepare for git-for-windows

Expand Down