-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathprofile.Jack-xps.template
97 lines (82 loc) · 2.2 KB
/
profile.Jack-xps.template
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
$Store = 'ps'
$StoreRoot = "f:/src/ps"
Invoke-Expression ". $(join-path $StoreRoot 'Import-Store.ps1')"
Import-Store -Store $Store -StoreRoot $StoreRoot
function get-list{
get-childitem @args | format-wide -autosize
}
function new-directory{
new-item -type directory -name $args[0]
Set-Location $args[0]
}
function git-bash{
[string]$string = "$env:ProgramFiles\git\bin\sh.exe --login"
& $string
}
function git-server{
<#
.Synopsis
Open a git server for sharing repositories
.Description
Common Ports;
ssh:// - 22
git:// - Default 9418
http:// - 80
https:// - 443
#>
Param(
$Port = 9418,
$BasePath= 'F:/repo',
[switch]$EnablePush
)
if($EnablePush){
iex -Command "git daemon --verbose --base-path=$BasePath --reuseaddr --port=$port --export-all --enable=receive-pack"
}else{
iex -Command "git daemon --verbose --base-path=$BasePath --reuseaddr --port=$port --export-all"
}
}
function touch{
Param(
[Parameter(Mandatory=$true)]
[string]$name
)
if(-not (test-path $name)){
new-item -type file $name -force
} else {
Write-Warning "$name exists"
}
}
# Set up a simple prompt, adding the git prompt parts inside git repos
function global:prompt {
$realLASTEXITCODE = $LASTEXITCODE
# Reset color, which can be messed up by Enable-GitColors
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
Write-Host($pwd.ProviderPath) -nonewline -ForegroundColor Green
Write-VcsStatus
$global:LASTEXITCODE = $realLASTEXITCODE
[System.Environment]::NewLine + "$env:USERNAME $ "
}
function swap-python {
if($env:path -match 'Python27'){
$env:Path = $env:path.replace('Python27', 'Python33')
} else {
$env:Path = $env:path.replace('Python33', 'Python27')
}
}
function Backup-Profile {
$profile = @{
Path = $profile.CurrentUserAllHosts
Destination = join-path $StoreRoot "profile.Jack-xps.template"
Force = $true
}
Copy-Item @profile
}
Set-Alias sh git-bash
Set-Alias lsa get-list
Set-Alias new new-directory
Set-Alias v vagrant
Set-Alias g git
Enable-GitColors
# Start-SshAgent -Quiet
Set-Location "F:\src"
lsa -Directory