-
Notifications
You must be signed in to change notification settings - Fork 2k
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
better git path handling #865
Conversation
@@ -41,6 +41,8 @@ try { | |||
# Check if git is on PATH, i.e. Git already installed on system | |||
Get-command -Name "git" -ErrorAction Stop >$null | |||
} catch { | |||
$env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\cmd") | |||
# for bash.exe, which in the cmd version is found as <GIT>\usr\bin\bash.exe | |||
$env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\bin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure if this is a nice thing to keep the ...\bin
version: the problem is that if the user has added git to the path (via the git for windows installer), then bash is not found as the installer does not add bin to the path.
IMO both version should result in the same apps visible in path... Not sure how to ensure that, probably by setting GIT_INSTALL_PATH and then unconditionally adding the bin path?
I did add it to mine. |
Updated and repushed |
Could you resync, your branch again? Thanks. |
The idea is: * if the users points as to a specific git, use that * test if a git is in path and if yes, use that * last, use our vendored git We don't make any attempt to guess a different location, if a user wants their own git install, they have to choose "add git to path". Also check that we have a recent enough version of git (e.g. test for <GIT>\cmd\git.exe)
Some unix commands shadow windows commands and therefor the unix commands should be at the end of the PATH
The only reason was bash but bash.exe is also in <GIT>\usr\bin.
This ensures that the "normal" path entry (cmd) is first and bash is still reachable via the bin path.
Updated, sorry for the long delay, seems I missed the rebase request. |
This PR contains
threetwo main commits