mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-13 03:09:10 +08:00
cmder_shell settings
This commit is contained in:
parent
823e6fee6e
commit
823eeaf082
33
vendor/init.bat
vendored
33
vendor/init.bat
vendored
@ -33,7 +33,6 @@ call "%cmder_root%\vendor\lib\lib_console"
|
|||||||
call "%cmder_root%\vendor\lib\lib_git"
|
call "%cmder_root%\vendor\lib\lib_git"
|
||||||
call "%cmder_root%\vendor\lib\lib_profile"
|
call "%cmder_root%\vendor\lib\lib_profile"
|
||||||
|
|
||||||
|
|
||||||
:var_loop
|
:var_loop
|
||||||
if "%~1" == "" (
|
if "%~1" == "" (
|
||||||
goto :start
|
goto :start
|
||||||
@ -86,6 +85,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
goto var_loop
|
goto var_loop
|
||||||
|
|
||||||
:start
|
:start
|
||||||
|
:: Sets CMDER_SHELL, CMDER_CLINK, CMDER_ALIASES
|
||||||
%lib_base% cmder_shell
|
%lib_base% cmder_shell
|
||||||
%lib_console% debug_output init.bat "Env Var - CMDER_ROOT=%CMDER_ROOT%"
|
%lib_console% debug_output init.bat "Env Var - CMDER_ROOT=%CMDER_ROOT%"
|
||||||
%lib_console% debug_output init.bat "Env Var - debug_output=%debug_output%"
|
%lib_console% debug_output init.bat "Env Var - debug_output=%debug_output%"
|
||||||
@ -103,22 +103,22 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
|||||||
set architecture_bits=64
|
set architecture_bits=64
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%CMDER_SHELL%" neq "tcc.exe" (
|
if "%CMDER_CLINK%" == "1" (
|
||||||
:: Tell the user about the clink config files...
|
%lib_console% verbose_output "Injecting Clink..."
|
||||||
if defined "%CMDER_USER_CONFIG%\settings" if not exist "%CMDER_USER_CONFIG%\settings" (
|
|
||||||
echo Generating clink initial settings in "%CMDER_USER_CONFIG%\settings"
|
|
||||||
echo Additional *.lua files in "%CMDER_USER_CONFIG%" are loaded on startup.\
|
|
||||||
|
|
||||||
) else 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
|
:: Run clink
|
||||||
if defined CMDER_USER_CONFIG (
|
if defined CMDER_USER_CONFIG (
|
||||||
"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor"
|
if not exist "%CMDER_USER_CONFIG%\settings" (
|
||||||
|
echo Generating clink initial settings in "%CMDER_USER_CONFIG%\settings"
|
||||||
|
echo Additional *.lua files in "%CMDER_USER_CONFIG%" are loaded on startup.\
|
||||||
|
)
|
||||||
|
"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_USER_CONFIG%" --scripts "%CMDER_ROOT%\vendor"
|
||||||
) else (
|
) else (
|
||||||
"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
|
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.
|
||||||
|
)
|
||||||
|
"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -250,8 +250,7 @@ if not defined user_aliases (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if "%CMDER_ALIASES%" == "1" (
|
||||||
if "%CMDER_SHELL%" neq "tcc.exe" (
|
|
||||||
REM The aliases environment variable is used by alias.bat to id
|
REM The aliases environment variable is used by alias.bat to id
|
||||||
REM the default file to store new aliases in.
|
REM the default file to store new aliases in.
|
||||||
if not defined aliases (
|
if not defined aliases (
|
||||||
@ -340,8 +339,8 @@ echo.
|
|||||||
echo @echo off
|
echo @echo off
|
||||||
) >"%initialConfig%"
|
) >"%initialConfig%"
|
||||||
)
|
)
|
||||||
echo %comspec% | find /i "tcc.exe">nul
|
|
||||||
if %errorlevel% == 1 if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMDER_ROOT%\vendor\bin\alias.cmd" (
|
if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMDER_ROOT%\vendor\bin\alias.cmd" (
|
||||||
echo Cmder's 'alias' command has been moved into '%CMDER_ROOT%\vendor\bin\alias.cmd'
|
echo Cmder's 'alias' command has been moved into '%CMDER_ROOT%\vendor\bin\alias.cmd'
|
||||||
echo to get rid of this message either:
|
echo to get rid of this message either:
|
||||||
echo.
|
echo.
|
||||||
|
14
vendor/lib/lib_base.cmd
vendored
14
vendor/lib/lib_base.cmd
vendored
@ -61,6 +61,16 @@ exit /b
|
|||||||
::: file <in> full path to file containing lib_routines to display
|
::: file <in> full path to file containing lib_routines to display
|
||||||
:::.
|
:::.
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
echo %comspec% | find /i "\cmd.exe" > nul && set "CMDER_SHELL=cmd.exe"
|
echo %comspec% | find /i "\cmd.exe" > nul && set "CMDER_SHELL=cmd"
|
||||||
echo %comspec% | find /i "\tcc.exe" > nul && set "CMDER_SHELL=tcc.exe"
|
echo %comspec% | find /i "\tcc.exe" > nul && set "CMDER_SHELL=tcc"
|
||||||
|
echo %comspec% | find /i "\tccle" > nul && set "CMDER_SHELL=tccle"
|
||||||
|
|
||||||
|
set CMDER_CLINK=1
|
||||||
|
if "%CMDER_SHELL%" equ "tcc" set CMDER_CLINK=0
|
||||||
|
if "%CMDER_SHELL%" equ "tccle" set CMDER_CLINK=0
|
||||||
|
|
||||||
|
set CMDER_ALIASES=1
|
||||||
|
if "%CMDER_SHELL%" equ "tcc" set CMDER_ALIASES=0
|
||||||
|
if "%CMDER_SHELL%" equ "tccle" set CMDER_ALIASES=0
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
Loading…
Reference in New Issue
Block a user