-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
Pass "git.exe" instead of "git" to Get-Command #478
Conversation
Passing just "git" to get-command causes the script to fail if you have an alias called "git". For example, I have hub installed (https://github.com/github/hub), which recommends aliasing git=hub. However, after doing this it breaks this posh-git script because `get-command git` returns the new alias which has no path. Running `get-command git` returns: CommandType Name Version Source ----------- ---- ------- ------ Alias git -> hub.exe But `get-command git.exe` returns: CommandType Name Version Source ----------- ---- ------- ------ Application git.exe 2.13.2.1 C:\Program Files\Git\cmd\git.exe
This works for me. There's a small chance this is a regression for folks with an older version of Git, which may have only put |
(Thanks!) |
My pleasure. Good call on looking for *git.cmd*. I suppose the script could
be updated to look for both variants.
…On Mon, 10 Jul 2017 at 16:41 Keith Dahlby ***@***.***> wrote:
(Thanks!)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#478 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAxgqWoaFcGQJFaU0-F5QCy7p2UFLGA9ks5sMqidgaJpZM4OTfYU>
.
|
I expect |
A bit further digging and I would have this much better fix:
Get-Command git -CommandType Application
…On Mon, 10 Jul 2017 at 16:45 Keith Dahlby ***@***.***> wrote:
I expect Get-Command git.exe,git.cmd -ErrorAction SilentlyContinue would
do the trick?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#478 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAxgqTW8ZtioYCbjUaUpHeqnqhybQCnYks5sMqmdgaJpZM4OTfYU>
.
|
Related dahlbyk#478. This is a better fix. By specifying the CommandType as Application we can continue looking for `git` (exe or cmd) but avoiding any potential aliases the user may have created for "git".
A better fix for this is to use the |
Related #478. This is a better fix. By specifying the CommandType as Application we can continue looking for `git` (exe or cmd) but avoiding any potential aliases the user may have created for "git".
Passing just "git" to
get-command
causes the script to fail if you have an alias called "git". For example, I have hub installed , which recommends aliasing git=hub. However, after doing this it breaks this posh-git script becauseget-command git
returns the new alias which has no path.Running
get-command git
returns:CommandType Name Version Source
But
get-command git.exe
returns:CommandType Name Version Source