refactor parameter handling in get-build-info.ps1
This commit is contained in:
parent
ba0af93cdc
commit
ab8896961f
1 changed files with 6 additions and 9 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue