juniper/_build/cargo-make.ps1
Christian Legnitto e6923defb1
Fix CI (#288)
2018-12-07 11:57:17 -07:00

21 lines
700 B
PowerShell

param (
[Parameter(Mandatory=$true)][string]$version,
[Parameter(Mandatory=$true)][string]$target
)
# Location to put cargo-make binary.
$cargobindir = "$env:userprofile\.cargo\bin"
# Location to stage downloaded zip file.
$zipfile = "$env:temp\cargo-make.zip"
$url = "https://github.com/sagiegurari/cargo-make/releases/download/${version}/cargo-make-v${version}-${target}.zip"
# Download the zip file.
Invoke-WebRequest -Uri $url -OutFile $zipfile
# Extract the binary to the correct location.
Expand-Archive -Path $zipfile -DestinationPath $cargobindir
# Tell azure pipelines the PATH has changed for future steps.
Write-Host "##vso[task.setvariable variable=PATH;]%PATH%;$cargobindir"