blessing-skin-plugins/download-nano.ps1
2020-08-15 14:49:58 +08:00

8 lines
437 B
PowerShell

$token = 'Bearer ' + $env:GITHUB_TOKEN
$headers = @{"authorization"=$token}
$nanoRelease = (Invoke-WebRequest 'https://api.github.com/repos/bs-community/nano/releases/latest' -Headers $headers).Content | ConvertFrom-Json
$nanoBinUrl = ((Invoke-WebRequest $nanoRelease.assets_url -Headers $headers).Content | ConvertFrom-Json).browser_download_url
bash -c "curl -fSL $nanoBinUrl --header 'authorization: $token' -o nano"
chmod +x ./nano