Skip to content

Commit

Permalink
Merge pull request #169 from paulmarsy/module-removebug
Browse files Browse the repository at this point in the history
Fixing a bug where the Git Status is written multiple times
  • Loading branch information
dahlbyk committed May 22, 2015
2 parents f948f5a + 9476e30 commit 3d04e61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ if(!(Test-Path Variable:Global:VcsPromptStatuses)) {
function Global:Write-VcsStatus { $Global:VcsPromptStatuses | foreach { & $_ } }

# Add scriptblock that will execute for Write-VcsStatus
$Global:VcsPromptStatuses += {
$PoshGitVcsPrompt = {
$Global:GitStatus = Get-GitStatus
Write-GitStatus $GitStatus
}
$Global:VcsPromptStatuses += $PoshGitVcsPrompt
$ExecutionContext.SessionState.Module.OnRemove = { $Global:VcsPromptStatuses = $Global:VcsPromptStatuses | ? { $_ -ne $PoshGitVcsPrompt} }

0 comments on commit 3d04e61

Please sign in to comment.