refactor: rename Themes folder for consistency

This commit is contained in:
Jan De Dobbeleer 2020-09-25 08:42:47 +02:00 committed by Jan De Dobbeleer
parent 6c17689966
commit 2b0b36b835
3 changed files with 10 additions and 10 deletions

View file

@ -162,8 +162,8 @@ a few general properties are available cross segments which can be found in `pro
[kofi-badge]: https://img.shields.io/badge/Ko--fi-Buy%20me%20a%20coffee!-%2346b798.svg
[kofi]: https://ko-fi.com/jandedobbeleer
[releases]: https://github.com/JanDeDobbeleer/go-my-posh/releases
[jandedobbeleer]: https://github.com/JanDeDobbeleer/go-my-posh/blob/master/Themes/jandedobbeleer.json
[themes]: https://github.com/JanDeDobbeleer/go-my-posh/tree/master/Themes
[jandedobbeleer]: https://github.com/JanDeDobbeleer/go-my-posh/blob/master/themes/jandedobbeleer.json
[themes]: https://github.com/JanDeDobbeleer/go-my-posh/tree/master/themes
[chrisbenti-psconfig]: https://github.com/chrisbenti/PS-Config
[keithdahlby-poshgit]: https://github.com/dahlbyk/posh-git
[oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh

View file

@ -17,7 +17,7 @@ Param
# set the actual version number
(Get-Content '.\go-my-posh.psd1' -Raw).Replace('0.0.0.1', $ModuleVersion) | Out-File -Encoding 'UTF8' '.\go-my-posh.psd1'
# copy all themes into the module folder
Copy-Item -Path "../../../Themes" -Destination "./Themes" -Recurse
Copy-Item -Path "../../../themes" -Destination "./themes" -Recurse
# fetch all the binaries from the version's GitHub release
New-Item -Path "./" -Name "bin" -ItemType "directory"
"posh-windows-amd64.exe", "posh-darwin-amd64", "posh-linux-amd64" | ForEach-Object -Process {
@ -33,5 +33,5 @@ if ($RepositoryAPIKey) {
# reset module version (for local testing only as we don't want PR's with changed version numbers all the time)
(Get-Content '.\go-my-posh.psd1' -Raw).Replace($ModuleVersion, '0.0.0.1') | Out-File -Encoding 'UTF8' '.\go-my-posh.psd1'
Remove-Item "./bin" -Recurse -Force
Remove-Item "./Themes" -Recurse -Force
Remove-Item "./themes" -Recurse -Force

View file

@ -4,7 +4,7 @@
#>
$global:PoshSettings = New-Object -TypeName PSObject -Property @{
Theme = "$PSScriptRoot\Themes\jandedobbeleer.json"
Theme = "$PSScriptRoot\themes\jandedobbeleer.json"
}
function Get-PoshCommand {
@ -38,14 +38,14 @@ function Set-PoshPrompt {
$Theme
)
if (Test-Path "$PSScriptRoot/Themes/$Theme.json") {
$global:PoshSettings.Theme = "$PSScriptRoot/Themes/$Theme.json"
if (Test-Path "$PSScriptRoot/themes/$Theme.json") {
$global:PoshSettings.Theme = "$PSScriptRoot/themes/$Theme.json"
}
elseif (Test-Path $Theme) {
$global:PoshSettings.Theme = $Theme
}
else {
$global:PoshSettings.Theme = "$PSScriptRoot/Themes/jandedobbeleer.json"
$global:PoshSettings.Theme = "$PSScriptRoot/themes/jandedobbeleer.json"
}
[ScriptBlock]$Prompt = {
@ -75,7 +75,7 @@ function Get-PoshThemes {
'@
Write-Host $logo
$poshCommand = Get-PoshCommand
Get-ChildItem -Path "$PSScriptRoot\Themes\*" -Include '*.json' | Sort-Object Name | ForEach-Object -Process {
Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.json' | Sort-Object Name | ForEach-Object -Process {
Write-Host ("=" * $consoleWidth)
Write-Host "$esc[1m$($_.BaseName)$esc[0m"
Write-Host ""
@ -112,7 +112,7 @@ function ThemeCompletion {
$commandAst,
$fakeBoundParameter
)
$themes = Get-ChildItem -Path "$PSScriptRoot\Themes\*" -Include '*.json' | Sort-Object Name | Select-Object -Property BaseName
$themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.json' | Sort-Object Name | Select-Object -Property BaseName
$themes |
Where-Object { $_.BaseName.ToLower().StartsWith($wordToComplete.ToLower()); } |
Select-Object -Unique -ExpandProperty BaseName |