Merge remote-tracking branch 'origin' into user_lua

This commit is contained in:
Dax T. Games
2018-09-01 14:35:41 -04:00
24 changed files with 480 additions and 185 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

41
vendor/cmder.sh vendored
View File

@ -1,10 +1,10 @@
# DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE
#
# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh,
# Add portable user customizations ${CMDER_ROOT}/config/user_profile.sh,
# these customizations will follow Cmder if $CMDER_ROOT is copied
# to another machine.
#
# Add system specific users customizations to $HOME/.bashrc, these
# Add system specific users customizations to $HOME/.bashrc, these
# customizations will not follow Cmder to another machine.
function runProfiled {
@ -14,7 +14,7 @@ function runProfiled {
if [ ! "x${profile_d_scripts}" = "x" ] ; then
for x in ${profile_d_scripts} ; do
echo Sourcing "${1}/${x}"...
# echo Sourcing "${1}/${x}"...
. "${1}/${x}"
done
fi
@ -63,21 +63,32 @@ if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then
runProfiled "${CMDER_USER_CONFIG}/profile.d"
fi
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
. "${CMDER_ROOT}/config/user-profile.sh"
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then
mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh"
fi
if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then
. "${CMDER_USER_CONFIG}/user-profile.sh"
else
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
initialProfile="${CMDER_USER_CONFIG}/user-profile.sh"
else
initialProfile="${CMDER_ROOT}/config/user-profile.sh"
fi
CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh"
if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then
. "${CMDER_ROOT}/config/user_profile.sh"
fi
echo Creating user startup file: "${initialProfile}"
cat <<-eof >"${initialProfile}"
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then
mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh"
fi
CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh"
if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then
. "${CMDER_USER_CONFIG}/user_profile.sh"
fi
fi
if [ ! -f "${CmderUserProfilePath}" ] ; then
echo Creating user startup file: "${CmderUserProfilePath}"
cat <<-eof >"${CmderUserProfilePath}"
# use this file to run your own startup commands for msys2 bash'
# To add a new vendor to the path, do something like:

58
vendor/cmder_exinit vendored
View File

@ -1,4 +1,4 @@
# Copy this file to your non integrated *nix-like environment,
# Copy this file to your non integrated *nix-like environment,
# Cygwin/MSys2/Git for Windows SDK, installs '/etc/profile.d/'
# folder to integrate the externally installed Unix like environment
# into Cmder so it has access to settings stored in Cmder/config
@ -15,7 +15,7 @@
# These customizations will follow Cmder if $CMDER_ROOT is copied
# to another machine.
#
# Add system specific users customizations to $HOME/.bashrc, these
# Add system specific users customizations to $HOME/.bashrc, these
# customizations will not follow Cmder to another machine.
# # Uncomment and edit the CMDER_ROOT line to use Cmder/config even when launched
@ -58,45 +58,55 @@ fi
if [ ! "$CMDER_ROOT" = "" ] ; then
# Remove any trailing '/'
CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')
echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"."
export CMDER_ROOT
PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT}
export PATH
# Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d"
# to source them at startup.
if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then
mkdir -p "${CMDER_ROOT}/config/profile.d"
fi
if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then
runProfiled "${CMDER_ROOT}/config/profile.d"
fi
if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then
runProfiled "${CMDER_USER_CONFIG}/profile.d"
fi
if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then
. "${CMDER_ROOT}/config/user-profile.sh"
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then
mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh"
fi
if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then
. "${CMDER_USER_CONFIG}/user-profile.sh"
else
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
initialProfile="${CMDER_USER_CONFIG}/user-profile.sh"
else
initialProfile="${CMDER_ROOT}/config/user-profile.sh"
fi
echo Creating user startup file: "${initialProfile}"
cat <<-eof >"${initialProfile}"
CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh"
if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then
. "${CMDER_ROOT}/config/user_profile.sh"
fi
if [ "${CMDER_USER_CONFIG}" != "" ] ; then
# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency.
if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then
mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh"
fi
CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh"
if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then
. "${CMDER_USER_CONFIG}/user_profile.sh"
fi
fi
if [ ! -f "${CmderUserProfilePath}" ] ; then
echo Creating user startup file: "${CmderUserProfilePath}"
cat <<-eof >"${CmderUserProfilePath}"
# use this file to run your own startup commands for msys2 bash'
# To add a new vendor to the path, do something like:

71
vendor/init.bat vendored
View File

@ -4,7 +4,7 @@
:: Created as part of cmder project
:: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
:: !!! Use "%CMDER_ROOT%\config\user-profile.cmd" to add your own startup commands
:: !!! Use "%CMDER_ROOT%\config\user_profile.cmd" to add your own startup commands
:: Use /v command line arg or set to > 0 for verbose output to aid in debugging.
set verbose-output=0
@ -36,11 +36,11 @@ call "%cmder_root%\vendor\lib\lib_profile"
:var_loop
if "%~1" == "" (
goto :start
) else if "%1"=="/v" (
) else if /i "%1"=="/v" (
set verbose-output=1
) else if "%1"=="/d" (
) else if /i "%1"=="/d" (
set debug-output=1
) else if "%1" == "/max_depth" (
) else if /i "%1" == "/max_depth" (
if "%~2" geq "1" if "%~2" leq "5" (
set "max_depth=%~2"
shift
@ -48,7 +48,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
%lib_console% show_error "'/max_depth' requires a number between 1 and 5!"
exit /b
)
) else if "%1" == "/c" (
) else if /i "%1" == "/c" (
if exist "%~2" (
if not exist "%~2\bin" mkdir "%~2\bin"
set "cmder_user_bin=%~2\bin"
@ -56,12 +56,12 @@ call "%cmder_root%\vendor\lib\lib_profile"
set "cmder_user_config=%~2\config"
shift
)
) else if "%1" == "/user_aliases" (
) else if /i "%1" == "/user_aliases" (
if exist "%~2" (
set "user-aliases=%~2"
shift
)
) else if "%1" == "/git_install_root" (
) else if /i "%1" == "/git_install_root" (
if exist "%~2" (
set "GIT_INSTALL_ROOT=%~2"
shift
@ -69,7 +69,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
%lib_console% show_error "The Git install root folder "%~2", you specified does not exist!"
exit /b
)
) else if "%1" == "/home" (
) else if /i "%1" == "/home" (
if exist "%~2" (
set "HOME=%~2"
shift
@ -77,7 +77,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
%lib_console% show_error The home folder "%2", you specified does not exist!
exit /b
)
) else if "%1" == "/svn_ssh" (
) else if /i "%1" == "/svn_ssh" (
set SVN_SSH=%2
shift
)
@ -129,12 +129,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!
@ -182,7 +184,7 @@ for /F "delims=" %%F in ('where git.exe 2^>nul') do (
:VENDORED_GIT
if exist "%CMDER_ROOT%\vendor\git-for-windows" (
set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows"
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd"
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd"
) else (
goto :NO_GIT
)
@ -197,18 +199,26 @@ if defined GIT_INSTALL_ROOT (
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64" append
)
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" append
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" append
:: define SVN_SSH so we can use git svn with ssh svn repositories
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
for /F "delims=" %%F in ('env /usr/bin/locale -uU 2^>nul') do (
set "LANG=%%F"
)
)
:NO_GIT
endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
endlocal & set "PATH=%PATH%" & set "LANG=%LANG%" & 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
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth%
: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%
)
@ -287,16 +297,22 @@ if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
if not defined HOME set "HOME=%USERPROFILE%"
%lib_console% debug-output init.bat "Env Var - HOME=%HOME%"
if exist "%CMDER_ROOT%\config\user-profile.cmd" (
set "initialConfig=%CMDER_ROOT%\config\user_profile.cmd"
if exist "%CMDER_ROOT%\config\user_profile.cmd" (
REM Create this file and place your own command in there
call "%CMDER_ROOT%\config\user-profile.cmd"
call "%CMDER_ROOT%\config\user_profile.cmd"
)
if defined CMDER_USER_CONFIG if exist "%CMDER_USER_CONFIG%\user-profile.cmd" (
REM Create this file and place your own command in there
call "%CMDER_USER_CONFIG%\user-profile.cmd"
) else (
echo Creating user startup file: "%CMDER_ROOT%\config\user-profile.cmd"
if defined CMDER_USER_CONFIG (
set "initialConfig=%CMDER_USER_CONFIG%\user_profile.cmd"
if exist "%CMDER_USER_CONFIG%\user_profile.cmd" (
REM Create this file and place your own command in there
call "%CMDER_USER_CONFIG%\user_profile.cmd"
)
)
if not exist "%initialConfig%" (
echo Creating user startup file: "%initialConfig%"
(
echo :: use this file to run your own startup commands
echo :: use in front of the command to prevent printing the command
@ -312,13 +328,8 @@ echo :: you can add your plugins to the cmder path like so
echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%"
echo.
echo @echo off
) >"%temp%\user-profile.tmp"
if defined CMDER_USER_CONFIG (
copy "%temp%\user-profile.tmp" "%CMDER_USER_CONFIG%\user-profile.cmd"
) else (
copy "%temp%\user-profile.tmp" "%CMDER_ROOT%\config\user-profile.cmd"
)
) >"%initialConfig%"
)
set initialConfig=
exit /b

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:
:::.
@ -76,5 +76,4 @@ exit /b
:::-------------------------------------------------------------------------------
echo ERROR: %~1
echo CMDER Shell Initialization has Failed!
exit /b

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:
:::.
@ -46,7 +46,7 @@ exit /b
:: check if the executable actually exists
if not exist "%git_executable%" (
%lib_console% show_error "%git_executable%" does not exist!
%lib_console% debug-output :read_version "%git_executable% does not exist."
exit /b -255
)

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:
:::

34
vendor/profile.ps1 vendored
View File

@ -2,7 +2,7 @@
# Created as part of cmder project
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands
# !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands
# Compatibility with PS major versions <= 2
if(!$PSScriptRoot) {
@ -97,7 +97,7 @@ $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT"
#
# Prompt Section
# Users should modify their user-profile.ps1 as it will be safe from updates.
# Users should modify their user_profile.ps1 as it will be safe from updates.
#
# Pre assign the hooks so the first run of cmder gets a working prompt.
@ -134,37 +134,45 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) {
pushd $ENV:CMDER_ROOT\config\profile.d
foreach ($x in Get-ChildItem *.ps1) {
# write-host write-host Sourcing $x
. $x
Import-Module $x
}
popd
# Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d"
# to source them at startup. Requires using cmder.exe /C [cmder_user_root_path] argument
if ($ENV:CMDER_USER_CONFIG -ne "" -and -not (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) {
if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) {
pushd $ENV:CMDER_USER_CONFIG\profile.d
foreach ($x in Get-ChildItem *.ps1) {
# write-host write-host Sourcing $x
. $x
Import-Module $x
}
popd
}
# Renaming to "config\user_profile.ps1" to "user_profile.ps1" for consistency.
if (test-path "$env:CMDER_ROOT\config\user-profile.ps1") {
rename-item "$env:CMDER_ROOT\config\user-profile.ps1" user_profile.ps1
}
$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1"
$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"
Import-Module "$CmderUserProfilePath"
}
if ($ENV:CMDER_USER_CONFIG) {
$CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1"
# Renaming to "$env:CMDER_USER_CONFIG\user-profile.ps1" to "user_profile.ps1" for consistency.
if (test-path "$env:CMDER_USER_CONFIG\user-profile.ps1") {
rename-item "$env:CMDER_USER_CONFIG\user-profile.ps1" user_profile.ps1
}
$CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user_profile.ps1"
if (Test-Path $CmderUserProfilePath) {
Import-Module "$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.16.3.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.16.3.windows.1/PortableGit-2.16.3-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": "180318",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.03.18/ConEmuPack.180318.7z"
"version": "180528",
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.05.28/ConEmuPack.180528.7z"
},
{
"name": "clink-completions",