chore: remove the powershell module

This commit is contained in:
Jan De Dobbeleer 2022-05-19 07:27:04 +02:00 committed by Jan De Dobbeleer
parent c7a13e07a1
commit 098dcfd88b
6 changed files with 0 additions and 215 deletions

View file

@ -1,19 +0,0 @@
name: PowerShell
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
working-directory: ${{ github.workspace }}/packages/powershell
steps:
- name: Checkout code 👋
uses: actions/checkout@v2
- name: Pack & Push 📦
run: |
$version = $env:GITHUB_REF.TrimStart("refs/tags/v")
./deploy.ps1 -ModuleVersion $version -Repository PSGallery -RepositoryAPIKey ${{ secrets.PSGALLERY_KEY }}

View file

@ -14,7 +14,6 @@
[![Release][release-badge]][release]
[![Documentation][docs-badge]][docs]
[![PS Gallery][psgallery-badge]][powershell-gallery]
![GitHub Downloads][gh-downloads]
![Twitter][twitter]
@ -59,8 +58,6 @@ using Go (and the amazing [README][powerline-go])
* [Starship][starship] for creating an amazing way to initialize the prompt
[release-status]: https://img.shields.io/github/workflow/status/jandedobbeleer/oh-my-posh/Release?label=Build
[psgallery-badge]: https://img.shields.io/powershellgallery/dt/oh-my-posh?color=pink&label=PowerShell%20Downloads
[powershell-gallery]: https://www.powershellgallery.com/packages/oh-my-posh/
[gh-downloads]: https://img.shields.io/github/downloads/jandedobbeleer/oh-my-posh/total?color=pink&label=GitHub%20Downloads
[twitter]: https://shields.io/twitter/follow/jandedobbeleer?label=Follow
[kraken]: https://img.shields.io/badge/GitKraken-Legendary%20Git%20Tools-teal?style=plastic&logo=gitkraken

View file

@ -1,30 +0,0 @@
# PowerShell package
The goal of this module is to wrap the `oh-my-posh` binaries into a PowerShell module and allow easy installation
and ease of use when setting the prompt.
## Testing
## Create local package repository to validate changes locally
### Create the repository
```powershell
Register-PSRepository -Name 'LocalRepo' -SourceLocation 'C:\Repo' -PublishLocation 'C:\Repo' -InstallationPolicy Trusted
```
## Make changes and publish to your local repository
For ease testing, up the version number when using the build script, that way you are always able to update the module.
```powershell
deploy.ps1 -BinVersion 0.1.0 -ModuleVersion 0.0.2 -Repository LocalRepo
```
## Validate changes
Install/Update the module from your local repository and validate the changes.
```powershell
Install-Module oh-my-posh -Repository LocalRepo -Force
```

View file

@ -1,27 +0,0 @@
Param
(
[parameter(Mandatory=$true)]
[string]
$ModuleVersion,
[parameter(Mandatory=$true)]
[string]
$Repository,
[parameter(Mandatory=$false)]
[string]
$RepositoryAPIKey
)
$moduleDir = "./oh-my-posh"
New-Item -Path $moduleDir -ItemType Directory
# set the actual version number
(Get-Content './oh-my-posh.psd1' -Raw).Replace('0.0.0.1', $ModuleVersion) | Out-File -Encoding 'UTF8' "$moduleDir/oh-my-posh.psd1"
Copy-Item "./oh-my-posh.psm1" -Destination $moduleDir
Push-Location -Path $moduleDir
# publish the module
if ($RepositoryAPIKey) {
Publish-Module -Path . -Repository $Repository -NuGetApiKey $RepositoryAPIKey -Verbose
} else {
Publish-Module -Path . -Repository $Repository -Verbose
}
Pop-Location
Remove-Item -Path $moduleDir -Force -Recurse

View file

@ -1,46 +0,0 @@
#
# Module manifest for module 'oh-my-posh'
#
# Generated by: Jan De Dobbeleer
#
# Generated on: 11-Sep-20
#
@{
# Version number of this module.
ModuleVersion = '0.0.0.1'
# Script module or binary module file associated with this manifest.
RootModule = 'oh-my-posh.psm1'
# ID used to uniquely identify this module
GUID = '7d7c4a78-e2fe-4e5f-9510-34ac893e4562'
# Company or vendor of this module
CompanyName = 'Unknown'
# Author of this module
Author = 'Jan De Dobbeleer'
# Copyright statement for this module
Copyright = '(c) 2020 Jan De Dobbeleer. All rights reserved.'
# Description of the functionality provided by this module
Description = 'A prompt theme engine for any shell'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.0'
# List of all files packaged with this module
FileList = @()
# Cmdlets to export from this module
CmdletsToExport = @()
# Variables to export from this module
VariablesToExport = @()
# Aliases to export from this module
AliasesToExport = '*'
# Functions to export from this module
FunctionsToExport = @('Set-PoshPrompt')
# Private data to pass to the module specified in RootModule. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('git', 'agnoster', 'theme', 'zsh', 'posh-git', 'prompt', 'paradox', 'robbyrussel', 'oh-my-posh')
# A URL to the license for this module.
LicenseUri = 'https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/COPYING'
# A URL to the main website for this project.
ProjectUri = 'https://github.com/JanDeDobbeleer/oh-my-posh'
} # End of PSData hashtable
} # End of PrivateData hashtable
}

View file

@ -1,90 +0,0 @@
Write-Host @'
Hey friend
In an effort to grow oh-my-posh, the decision was made to no
longer support the PowerShell module. Over the past year, the
added benefit of the module disappeared, while the burden of
maintaining it increased.
However, this doesn't mean oh-my-posh disappears from your
terminal, it just means that you'll have to use a different
tool to install it.
All you need to do, is follow the migration guide here:
https://ohmyposh.dev/docs/migrating
'@
function Get-CachePath {
[CmdletBinding()]
param (
[Parameter()]
[string]
$Path
)
if (-Not (Test-Path -Path $Path)) {
return ""
}
$child = "oh-my-posh"
$cachePath = Join-Path -Path $Path -ChildPath $child
if (Test-Path -Path $cachePath) {
return $cachePath
}
$null = New-Item -Path $Path -Name $child -ItemType Directory
return $cachePath
}
function Set-PoshRootPath {
if ($env:POSH_PATH) {
return
}
$path = Get-CachePath -Path $env:LOCALAPPDATA
if ($path) {
$env:POSH_PATH = $path
return
}
$path = Get-CachePath -Path $env:XDG_CACHE_HOME
if ($path) {
$env:POSH_PATH = $path
return
}
$homeCache = Join-Path -Path $env:HOME -ChildPath ".cache"
$path = Get-CachePath -Path $homeCache
if ($path) {
$env:POSH_PATH = $path
return
}
$env:POSH_PATH = $env:HOME
}
Set-PoshRootPath
$env:PATH = $env:POSH_PATH + [System.IO.Path]::PathSeparator + $env:PATH
$env:POSH_THEMES_PATH = Join-Path -Path $env:POSH_PATH -ChildPath "themes"
function Set-PoshPrompt {
param(
[Parameter(Mandatory = $false)]
[string]
$Theme
)
$config = ""
if (Test-Path "$($env:POSH_THEMES_PATH)/$Theme.omp.json") {
$path = "$($env:POSH_THEMES_PATH)/$Theme.omp.json"
$config = (Resolve-Path -Path $path).ProviderPath
}
elseif (Test-Path $Theme) {
$config = (Resolve-Path -Path $Theme).ProviderPath
}
else {
$config = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v7.71.2/themes/default.omp.json"
}
# Workaround for get-location/push-location/pop-location from within a module
# https://github.com/PowerShell/PowerShell/issues/12868
# https://github.com/JanDeDobbeleer/oh-my-posh2/issues/113
$global:OMP_GLOBAL_SESSIONSTATE = $PSCmdlet.SessionState
oh-my-posh init pwsh --config="$config" | Invoke-Expression
}