Skip to content

Commit 16cca52

Browse files
committed
Merge pull request #22 from leandrw/master
Make sure break line before next command
2 parents 13f4cac + f9fead2 commit 16cca52

File tree

7 files changed

+73
-9
lines changed

7 files changed

+73
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Oh-My-Powershell
22
[![Join the chat at https://gitter.im/pecigonzalo/Oh-My-Powershell](https://badges.gitter.im/pecigonzalo/Oh-My-Powershell.svg)](https://gitter.im/pecigonzalo/Oh-My-Powershell?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
33

4-
After getting tired of mantaining my powershell profile, I decided to split the components and improve it, as I already use Oh-My-Zsh I thought it would be a good idea to have something similar on Powershell.
4+
After getting tired of mantaining my powershell profile, I decided to split the components and improve it, as I already use (Oh-My-Zsh)[ohmyz.sh] I thought it would be a good idea to have something similar on Powershell.
55

66
Please feel free to submit issues/pull requests/questions/feature reqeusts.
77

themes/base.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
function global:prompt {
22
$realLASTEXITCODE = $LASTEXITCODE
33
$Host.UI.RawUI.ForegroundColor = "White"
4+
Write-Host
45
Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green
56
if($gitStatus){
67
checkGit($pwd.ProviderPath)

themes/blocky.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
$realCommandStatus = $?
33
$realLASTEXITCODE = $LASTEXITCODE
44
$Path = $pwd.ProviderPath
5+
Write-Host
56
Write-Host " $Path " -NoNewLine -ForegroundColor Black -BackgroundColor White
67
if($gitStatus){
78
checkGit($Path)

themes/golagola.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function global:prompt {
1010

1111
$Path = $pwd.ProviderPath
1212

13-
13+
Write-Host
1414
Write-Host "$env:USERNAME" -NoNewLine -ForegroundColor Magenta
1515
Write-Host " @" -NoNewLine -ForegroundColor Yellow
1616
Write-Host " $Path " -NoNewLine -ForegroundColor Green

themes/norm.ps1

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<# Based on norm zsh theme. Check it (https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/norm.zsh-theme) #>
2+
3+
function global:prompt {
4+
$realCommandStatus = $?
5+
$realLASTEXITCODE = $LASTEXITCODE
6+
$lambda = [char]::ConvertFromUtf32(955)
7+
$forwardArrow = [char]::ConvertFromUtf32(8594)
8+
9+
if ( $realCommandStatus -eq $True ) {
10+
$EXIT="Yellow"
11+
} else {
12+
$EXIT="Red"
13+
}
14+
15+
$CurrentDirectory = Split-Path -leaf -path (Get-Location)
16+
17+
Write-Host
18+
Write-Host "$lambda $env:USERNAME " -ForegroundColor Yellow -NoNewline
19+
Write-Host "$CurrentDirectory" -NoNewLine -ForegroundColor Green
20+
21+
if(Get-GitStatus){
22+
Write-Host " $forwardArrow $lambda " -ForegroundColor Yellow -NoNewline
23+
Write-Host "git" -ForegroundColor Blue -NoNewline
24+
checkGit(Get-Location)
25+
}
26+
27+
Write-Host " $forwardArrow" -NoNewLine -ForegroundColor $EXIT
28+
$global:LASTEXITCODE = $realLASTEXITCODE
29+
return " "
30+
}
31+
32+
$global:PSColor = @{
33+
File = @{
34+
Default = @{ Color = 'White' }
35+
Directory = @{ Color = 'Green'}
36+
Reparse = @{ Color = 'Magenta'}
37+
Hidden = @{ Color = 'DarkGray'; Pattern = '^\.' }
38+
Code = @{ Color = 'Magenta'; Pattern = '\.(java|c|cpp|cs|js|css|html|Dockerfile|gradle|
39+
pp|packergitignore|gitattributes|go|)$' }
40+
Executable = @{ Color = 'Green'; Pattern = '\.(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg|sh|fsx|)$' }
41+
Text = @{ Color = 'Cyan'; Pattern = '\.(txt|cfg|conf|ini|csv|log|config|
42+
xml|yml|md|markdown|properties|json|todo)$' }
43+
Compressed = @{ Color = 'Yellow'; Pattern = '\.(zip|tar|gz|rar|jar|war)$' }
44+
}
45+
Service = @{
46+
Default = @{ Color = 'White' }
47+
Running = @{ Color = 'DarkGreen' }
48+
Stopped = @{ Color = 'DarkRed' }
49+
}
50+
Match = @{
51+
Default = @{ Color = 'White' }
52+
Path = @{ Color = 'Green'}
53+
LineNumber = @{ Color = 'Yellow' }
54+
Line = @{ Color = 'White' }
55+
}
56+
}

tools/check_for_updates.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ if ($AutoUpdate -eq $true) {
2323
if ($UpdateAfter -eq 0) { $update = 1 }
2424
# Call update script
2525
if ($update){
26-
Write-Host "Starting update process"
27-
& "$Env:USERPROFILE\.oh-my-powershell\update.ps1"
28-
Add-CurrentTime
29-
$update = 0
26+
# Ask for user confirmation about update
27+
$confirmation = Read-Host "Are you sure you want to update? [y/N]"
28+
if ($confirmation -ieq "y"){
29+
Write-Host "Starting update process"
30+
& "$Env:USERPROFILE\.oh-my-powershell\update.ps1"
31+
Add-CurrentTime
32+
$update = 0
33+
} else {
34+
"Update canceled"
35+
}
3036
} else {
31-
"No new updates to be installed"
37+
"No updates avaiable"
3238
}
3339
}
3440

update.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ if ($LASTEXITCODE) {
99
}
1010
Pop-Location
1111
# Copy module to the user modules folder
12-
Write-Host "Installting Oh-My-Powershell Module"
12+
Write-Host "Installing Oh-My-Powershell Module"
1313
New-Item -Type Directory "$([Environment]::GetFolderPath("mydocuments"))\WindowsPowerShell\Modules" -Force | Out-Null
1414
Copy-Item -Recurse -Force $Env:USERPROFILE\.oh-my-powershell\modules\oh-my-powershell `
1515
"$([Environment]::GetFolderPath("mydocuments"))\WindowsPowerShell\Modules\"
1616

1717
# If all good, let the user know
1818
if ($?) {
1919
Write-Host "Updated Oh-My-Powershell successfully!" -ForegroundColor Green
20-
Write-Host 'PLEASE RELOAD YOUR PROFILE DOING: .$PROFILE' -ForegroundColor Green
20+
Write-Host "PLEASE RELOAD YOUR PROFILE DOING: `n.$PROFILE" -ForegroundColor Green
2121
} else {
2222
Write-Host "Something went wrong with the update, you might need to reinstall" -ForegroundColor Red
2323
}

0 commit comments

Comments
 (0)