mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
28 lines
797 B
PowerShell
28 lines
797 B
PowerShell
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
|