fix: set $Global:GitStatus when Get-GitStatus exists

resolves #126
This commit is contained in:
Jan De Dobbeleer 2020-11-06 18:45:41 +01:00 committed by Jan De Dobbeleer
parent 36d58d46ad
commit aa36303962

View file

@ -26,6 +26,12 @@ if (!$IsWindows) {
function Set-PoshContext {}
function Set-GitStatus {
if (Get-Command -Name "Get-GitStatus" -ErrorAction SilentlyContinue) {
$Global:GitStatus = Get-GitStatus
}
}
function Set-PoshPrompt {
param(
[Parameter(Mandatory = $false)]
@ -70,6 +76,7 @@ function Set-PoshPrompt {
$standardOut
$global:LASTEXITCODE = $realLASTEXITCODE
Remove-Variable realLASTEXITCODE -Confirm:$false
Set-GitStatus
}
Set-Item -Path Function:prompt -Value $Prompt -Force
}