mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix(pwsh): publish module without irrelevant files
This commit is contained in:
parent
64a9e65e74
commit
603c4da30b
27
packages/powershell/deploy.ps1
Normal file
27
packages/powershell/deploy.ps1
Normal file
|
@ -0,0 +1,27 @@
|
|||
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
|
|
@ -91,6 +91,21 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
Param
|
||||
(
|
||||
[parameter(Mandatory=$true)]
|
||||
[string]
|
||||
$ModuleVersion,
|
||||
[parameter(Mandatory=$true)]
|
||||
[string]
|
||||
$Repository,
|
||||
[parameter(Mandatory=$false)]
|
||||
[string]
|
||||
$RepositoryAPIKey
|
||||
)
|
||||
|
||||
# set the actual version number
|
||||
(Get-Content '.\oh-my-posh.psd1' -Raw).Replace('0.0.0.1', $ModuleVersion) | Out-File -Encoding 'UTF8' '.\oh-my-posh.psd1'
|
||||
# publish the module
|
||||
$exclude = @('README.md','deploy.ps1')
|
||||
if ($RepositoryAPIKey) {
|
||||
Publish-Module -Path . -Repository $Repository -NuGetApiKey $RepositoryAPIKey -Exclude $exclude -Verbose
|
||||
} else {
|
||||
Publish-Module -Path . -Repository $Repository -Exclude $exclude -Verbose
|
||||
}
|
||||
# reset module version (for local testing only as we don't want PR's with changed version numbers all the time)
|
||||
(Get-Content '.\oh-my-posh.psd1' -Raw).Replace($ModuleVersion, '0.0.0.1') | Out-File -Encoding 'UTF8' '.\oh-my-posh.psd1'
|
Loading…
Reference in a new issue