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

Add /nix_tools 0 option to init.bat to prevent adding !GIT_INSTALL_ROOT!\usr\bin to PATH #1975

Merged
merged 1 commit into from
Dec 14, 2018
Merged
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
16 changes: 15 additions & 1 deletion vendor/init.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ set debug_output=0
set time_init=0
set fast_init=0
set max_depth=1
:: Add *nix tools to end of path. 0 turns off *nix tools.
set nix_tools=1
set "CMDER_USER_FLAGS= "

:: Find root dir
Expand Down Expand Up @@ -79,6 +81,16 @@ 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 /i "%1"=="/nix_tools" (
if "%2" equ "0" (
REM Do not add *nix tools to path
set nix_tools=0
shift
) else if "%2" equ "1" (
REM Add *nix tools to end of path
set nix_tools=1
shift
)
) else if /i "%1" == "/home" (
if exist "%~2" (
set "HOME=%~2"
Expand Down Expand Up @@ -239,7 +251,9 @@ if defined GIT_INSTALL_ROOT (
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64\bin" append
)
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" append
if %nix_tools% equ 1 (
%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"
Expand Down