fix: fix lastexitcode

This commit is contained in:
TravisTX 2020-12-30 07:49:08 -07:00 committed by Jan De Dobbeleer
parent c9075268ad
commit 23eb73cd69
2 changed files with 2 additions and 2 deletions

View file

@ -92,11 +92,11 @@ function Set-PoshPrompt {
$standardOut = $process.StandardOutput.ReadToEnd() $standardOut = $process.StandardOutput.ReadToEnd()
$process.WaitForExit() $process.WaitForExit()
$standardOut $standardOut
Set-GitStatus
$global:LASTEXITCODE = $realLASTEXITCODE $global:LASTEXITCODE = $realLASTEXITCODE
#remove temp variables #remove temp variables
Remove-Variable realLASTEXITCODE -Confirm:$false Remove-Variable realLASTEXITCODE -Confirm:$false
Remove-Variable lastCommandSuccess -Confirm:$false Remove-Variable lastCommandSuccess -Confirm:$false
Set-GitStatus
} }
Set-Item -Path Function:prompt -Value $Prompt -Force Set-Item -Path Function:prompt -Value $Prompt -Force
} }

View file

@ -56,10 +56,10 @@ function Set-GitStatus {
$standardOut = $process.StandardOutput.ReadToEnd() $standardOut = $process.StandardOutput.ReadToEnd()
$process.WaitForExit() $process.WaitForExit()
$standardOut $standardOut
Set-GitStatus
$global:LASTEXITCODE = $realLASTEXITCODE $global:LASTEXITCODE = $realLASTEXITCODE
#remove temp variables #remove temp variables
Remove-Variable realLASTEXITCODE -Confirm:$false Remove-Variable realLASTEXITCODE -Confirm:$false
Remove-Variable lastCommandSuccess -Confirm:$false Remove-Variable lastCommandSuccess -Confirm:$false
Set-GitStatus
} }
Set-Item -Path Function:prompt -Value $Prompt -Force Set-Item -Path Function:prompt -Value $Prompt -Force