forked from dahlbyk/posh-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.example.ps1.orig
42 lines (30 loc) · 1.07 KB
/
profile.example.ps1.orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
# Load posh-git module from current directory
Import-Module .\posh-git
# If module is installed in a default location ($env:PSModulePath),
# use this instead (see about_Modules for more information):
# Import-Module posh-git
# Set up a simple prompt, adding the git prompt parts inside git repos
function prompt {
$realLASTEXITCODE = $LASTEXITCODE
# Reset color, which can be messed up by Enable-GitColors
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
$m = 45 # maximum prompt length
$str = $pwd.Path
if ($str.length -ge $m)
{
$str = "..." + $str.substring($str.length - $m + 4)
}
Write-Host $str -nonewline -ForegroundColor "magenta"
Write-VcsStatus
<<<<<<< HEAD
$LASTEXITCODE = $realLASTEXITCODE
Write-Host
=======
$global:LASTEXITCODE = $realLASTEXITCODE
>>>>>>> 48728fcf14d6baaf148bc7bfc475e911974857ed
return "> "
}
Enable-GitColors
Pop-Location
Start-SshAgent -Quiet