forked from JeremySkinner/posh-svn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.example.ps1
39 lines (28 loc) · 1.06 KB
/
profile.example.ps1
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
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
# Load posh-svn module from current directory
Import-Module .\posh-svn
# If module is installed in a default location ($env:PSModulePath),
# use this instead (see about_Modules for more information):
# Import-Module posh-svn
# Set up a simple prompt, adding the svn prompt parts inside svn repos
function prompt {
Write-Host($pwd) -nonewline
# Svn Prompt
$Global:SvnStatus = Get-SvnStatus
Write-SvnStatus $SvnStatus
return "> "
}
if(-not (Test-Path Function:\DefaultTabExpansion)) {
Rename-Item Function:\TabExpansion DefaultTabExpansion
}
# Set up tab expansion and include svn expansion
function TabExpansion($line, $lastWord) {
$lastBlock = [regex]::Split($line, '[|;]')[-1]
switch -regex ($lastBlock) {
# svn tab expansion
'(svn) (.*)' { SvnTabExpansion($lastBlock) }
# Fall back on existing tab expansion
default { DefaultTabExpansion $line $lastWord }
}
}
Pop-Location