Merge branch 'master' into master

This commit is contained in:
Retomehere
2018-08-06 13:14:45 +08:00
committed by GitHub
12 changed files with 107 additions and 84 deletions

9
vendor/clink.lua vendored
View File

@ -41,13 +41,19 @@ local function set_prompt_filter()
-- color codes: "\x1b[1;37;40m"
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
local lambda = "λ"
cwd = string.gsub(cwd, "%%", "{percent}")
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
if env ~= nil then
lambda = "("..env..") "..lambda
end
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
end
local function percent_prompt_filter()
clink.prompt.value = string.gsub(clink.prompt.value, "{percent}", "%%")
end
---
-- Resolves closest directory location for specified directory.
-- Navigates subsequently up one level and tries to find specified directory
@ -235,7 +241,7 @@ end
-- Get the status of working dir
-- @return {bool}
---
function get_svn_status()
local function get_svn_status()
local file = io.popen("svn status -q")
for line in file:lines() do
file:close()
@ -340,6 +346,7 @@ clink.prompt.register_filter(set_prompt_filter, 1)
clink.prompt.register_filter(hg_prompt_filter, 50)
clink.prompt.register_filter(git_prompt_filter, 50)
clink.prompt.register_filter(svn_prompt_filter, 50)
clink.prompt.register_filter(percent_prompt_filter, 51)
local completions_dir = clink.get_env('CMDER_ROOT')..'/vendor/clink-completions/'
for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do

17
vendor/init.bat vendored
View File

@ -133,12 +133,14 @@ if not defined TERM set TERM=cygwin
:: * test if a git is in path and if yes, use that
:: * last, use our vendored git
:: also check that we have a recent enough version of git by examining the version string
setlocal enabledelayedexpansion
if defined GIT_INSTALL_ROOT (
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" goto :FOUND_GIT)
)
%lib_console% debug-output init.bat "Looking for Git install root..."
:: get the version information for vendored git binary
setlocal enabledelayedexpansion
%lib_git% read_version VENDORED "%CMDER_ROOT%\vendor\git-for-windows\cmd"
%lib_git% validate_version VENDORED !GIT_VERSION_VENDORED!
@ -207,11 +209,16 @@ if defined GIT_INSTALL_ROOT (
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
)
:NO_GIT
endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=!GIT_INSTALL_ROOT!"
%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=!GIT_INSTALL_ROOT!"
endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
%lib_console% debug-output init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
goto :PATH_ENHANCE
:: Enhance Path
:NO_GIT
:: Skip this if GIT WAS FOUND else we did 'endlocal' above!
endlocal
:PATH_ENHANCE
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth%
if defined CMDER_USER_BIN (
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" %max_depth%

View File

@ -3,7 +3,7 @@
set lib_base=call "%~dp0lib_base.cmd"
if "%~1" == "/h" (
%lib_base% help "%0"
%lib_base% help "%~0"
) else if "%1" neq "" (
call :%*
)
@ -16,7 +16,7 @@ exit /b
:::.
:::include:
:::.
::: call "$0"
::: call "lib_base.cmd"
:::.
:::usage:
:::.
@ -27,12 +27,9 @@ exit /b
::: file <in> full path to file containing lib_routines to display
:::.
:::-------------------------------------------------------------------------------
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| findstr /i /r "^:::"') do (
rem echo a="%%a"
if "%%a"==" " (
echo.
if "%%a"=="." (
echo.
) else if /i "%%a" == "usage" (

View File

@ -6,7 +6,7 @@ call "%~dp0lib_base.cmd"
set lib_console=call "%~dp0lib_console.cmd"
if "%~1" == "/h" (
%lib_base% help "%0"
%lib_base% help "%~0"
) else if "%1" neq "" (
call :%*
)
@ -19,7 +19,7 @@ exit /b
:::.
:::include:
:::.
::: call "$0"
::: call "lib_console.cmd"
:::.
:::usage:
:::.

View File

@ -7,7 +7,7 @@ set lib_git=call "%~dp0lib_git.cmd"
if "%~1" == "/h" (
%lib_base% help "%0"
%lib_base% help "%~0"
) else if "%1" neq "" (
call :%*
)
@ -20,7 +20,7 @@ exit /b
:::.
:::include:
:::.
::: call "$0"
::: call "lib_git.cmd"
:::.
:::usage:
:::.

View File

@ -6,7 +6,7 @@ call "%%~dp0lib_console"
set lib_path=call "%~dp0lib_path.cmd"
if "%~1" == "/h" (
%lib_base% help "%0"
%lib_base% help "%~0"
) else if "%1" neq "" (
call :%*
)
@ -19,7 +19,7 @@ exit /b
:::
:::include:
:::
::: call "$0"
::: call "lib_path.cmd"
:::
:::usage:
:::

View File

@ -6,7 +6,7 @@ call "%%~dp0lib_console"
set lib_profile=call "%~dp0lib_profile.cmd"
if "%~1" == "/h" (
%lib_base% help "%0"
%lib_base% help "%~0"
) else if "%1" neq "" (
call :%*
)
@ -19,7 +19,7 @@ exit /b
:::
:::include:
:::
::: call "$0"
::: call "lib_profile.cmd"
:::
:::usage:
:::

8
vendor/profile.ps1 vendored
View File

@ -155,16 +155,16 @@ $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1"
if (Test-Path $CmderUserProfilePath) {
# Create this file and place your own command in there.
. "$CmderUserProfilePath"
}
if ($ENV:CMDER_USER_CONFIG) {
$CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1"
if (Test-Path $CmderUserProfilePath) {
. "$CmderUserProfilePath"
}
}
if (Test-Path $CmderUserProfilePath) {
. "$CmderUserProfilePath"
} else {
if (! (Test-Path $CmderUserProfilePath) ) {
# This multiline string cannot be indented, for this reason I've not indented the whole block
Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath"

8
vendor/sources.json vendored
View File

@ -1,8 +1,8 @@
[
{
"name": "git-for-windows",
"version": "v2.17.0.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.17.0.windows.1/PortableGit-2.17.0-64-bit.7z.exe"
"version": "v2.17.1.windows.2",
"url": "https://github.com/git-for-windows/git/releases/download/v2.17.1.windows.2/PortableGit-2.17.1.2-64-bit.7z.exe"
},
{
"name": "clink",
@ -11,8 +11,8 @@
},
{
"name": "conemu-maximus5",
"version": "180416",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.04.16/ConEmuPack.180416.7z"
"version": "180528",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.05.28/ConEmuPack.180528.7z"
},
{
"name": "clink-completions",