refactor parameter handling in get-build-info.ps1

This commit is contained in:
amd64fox 2025-11-14 00:43:49 +03:00
parent ba0af93cdc
commit ab8896961f

View file

@ -1,3 +1,7 @@
param (
[string]$Url
)
function Find-BuildInfo {
[CmdletBinding()]
param (
@ -37,11 +41,7 @@ function Find-BuildInfo {
function Download-And-Unpack-Spotify {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$Url
)
$tempPath = Join-Path ([System.IO.Path]::GetTempPath()) "spotify"
$destinationPath = Join-Path $tempPath "unpacked"
$exePath = Join-Path $tempPath "SpotifySetup.exe"
@ -81,12 +81,9 @@ function Download-And-Unpack-Spotify {
}
}
param (
[string]$Url
)
if (-not [string]::IsNullOrEmpty($Url)) {
Download-And-Unpack-Spotify -Url $Url
Download-And-Unpack-Spotify
} else {
Write-Error "URL не был предоставлен."
echo "::set-output name=build_type::false"