mirror of
https://github.com/cmderdev/cmder.git
synced 2025-01-10 16:29:08 +08:00
add '/prefer_nix' switch to init.bat
This commit is contained in:
parent
22aa59bd83
commit
1eb03dd1b8
25
vendor/init.bat
vendored
25
vendor/init.bat
vendored
@ -14,6 +14,7 @@ set debug_output=0
|
|||||||
set time_init=0
|
set time_init=0
|
||||||
set fast_init=0
|
set fast_init=0
|
||||||
set max_depth=1
|
set max_depth=1
|
||||||
|
set prefer_windows_commands=1
|
||||||
set "CMDER_USER_FLAGS= "
|
set "CMDER_USER_FLAGS= "
|
||||||
|
|
||||||
:: Find root dir
|
:: Find root dir
|
||||||
@ -90,6 +91,9 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
) else if /i "%1" == "/svn_ssh" (
|
) else if /i "%1" == "/svn_ssh" (
|
||||||
set SVN_SSH=%2
|
set SVN_SSH=%2
|
||||||
shift
|
shift
|
||||||
|
) else if /i "%1" == "/prefer_nix" (
|
||||||
|
set prefer_windows_commands=0
|
||||||
|
shift
|
||||||
) else (
|
) else (
|
||||||
set "CMDER_USER_FLAGS=%1 %CMDER_USER_FLAGS%"
|
set "CMDER_USER_FLAGS=%1 %CMDER_USER_FLAGS%"
|
||||||
)
|
)
|
||||||
@ -233,18 +237,25 @@ goto :CONFIGURE_GIT
|
|||||||
:: Add git to the path
|
:: Add git to the path
|
||||||
if defined GIT_INSTALL_ROOT (
|
if defined GIT_INSTALL_ROOT (
|
||||||
rem add the unix commands at the end to not shadow windows commands like more
|
rem add the unix commands at the end to not shadow windows commands like more
|
||||||
if exist "!GIT_INSTALL_ROOT!\cmd\git.exe" %lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd" append
|
if "%prefer_windows_commands%" == "1" (
|
||||||
if exist "!GIT_INSTALL_ROOT!\mingw32" (
|
echo PREFERRING WINDOWS COMMANDS
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw32\bin" append
|
set "path_position=append"
|
||||||
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
|
) else (
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64\bin" append
|
echo PREFERRING UNIX COMMANDS
|
||||||
|
set "path_position="
|
||||||
)
|
)
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" append
|
|
||||||
|
|
||||||
|
if exist "!GIT_INSTALL_ROOT!\cmd\git.exe" %lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd" !path_position!
|
||||||
|
if exist "!GIT_INSTALL_ROOT!\mingw32" (
|
||||||
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw32\bin" !path_position!
|
||||||
|
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
|
||||||
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64\bin" !path_position!
|
||||||
|
)
|
||||||
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" !path_position!
|
||||||
:: define SVN_SSH so we can use git svn with ssh svn repositories
|
:: 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"
|
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') do (
|
for /F "delims=" %%F in ('%GIT_INSTALL_ROOT%\usr\bin\env /usr/bin/locale -uU 2') do (
|
||||||
set "LANG=%%F"
|
set "LANG=%%F"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user