chsrc/tool/download-release.ps1

38 lines
976 B
PowerShell
Raw Normal View History

2024-05-24 16:15:02 +08:00
# ---------------------------------------------------------------
# File : download-release.ps1
# Authors : Aoran Zeng <ccmywish@qq.com>
# Created on : <2023-09-21>
2024-06-08 18:14:30 +08:00
# Last modified : <2024-06-08>
2024-05-24 16:15:02 +08:00
#
# download:
#
# Download from GitHub Releases
# ---------------------------------------------------------------
$destination = "~\Desktop\chsrc-GitHub-release"
Write-Output "=> Mkdir $destination"
mkdir -Force $destination | Out-Null
Set-Location $destination
$names = @(
'chsrc-x64-windows.exe'
'chsrc-x86-windows.exe'
2024-06-08 18:14:30 +08:00
'chsrc-aarch64-macos'
2024-05-24 16:15:02 +08:00
'chsrc-x64-macos'
'chsrc-x64-linux'
'chsrc-aarch64-linux'
'chsrc-riscv64-linux'
'chsrc-armv7-linux'
)
2024-05-25 01:30:42 +08:00
# Like https://github.com/RubyMetric/chsrc/releases/download/latest/chsrc-x64-windows.exe
$url_prefix = "https://github.com/RubyMetric/chsrc/releases/download/latest/"
2024-05-24 16:15:02 +08:00
foreach ($name in $names) {
curl -LO "${url_prefix}${name}"
}
Set-Location -
Write-Output "=> Downloaded to $destination"