mirror of
https://github.com/RubyMetric/chsrc
synced 2025-07-17 20:57:28 +08:00
Update download script
This commit is contained in:
parent
fababf3aec
commit
4dc7908e74
@ -2,7 +2,7 @@
|
|||||||
# File Name : download-pre-on-GitHub.ps1
|
# File Name : download-pre-on-GitHub.ps1
|
||||||
# File Authors : Aoran Zeng <ccmywish@qq.com>
|
# File Authors : Aoran Zeng <ccmywish@qq.com>
|
||||||
# Created On : <2023-09-21>
|
# Created On : <2023-09-21>
|
||||||
# Last Modified : <2025-06-16>
|
# Last Modified : <2025-07-13>
|
||||||
#
|
#
|
||||||
# Download all files from the `pre` release on GitHub:
|
# Download all files from the `pre` release on GitHub:
|
||||||
# https://github.com/RubyMetric/chsrc/releases/tag/pre
|
# https://github.com/RubyMetric/chsrc/releases/tag/pre
|
||||||
@ -29,9 +29,20 @@ $names = @(
|
|||||||
# Like https://github.com/RubyMetric/chsrc/releases/download/latest/chsrc-x64-windows.exe
|
# Like https://github.com/RubyMetric/chsrc/releases/download/latest/chsrc-x64-windows.exe
|
||||||
$url_prefix = "https://github.com/RubyMetric/chsrc/releases/download/pre/"
|
$url_prefix = "https://github.com/RubyMetric/chsrc/releases/download/pre/"
|
||||||
|
|
||||||
foreach ($name in $names) {
|
Write-Output "=> Starting downloads..."
|
||||||
curl -LO "${url_prefix}${name}"
|
|
||||||
}
|
$names | ForEach-Object -Parallel {
|
||||||
|
$name = $_
|
||||||
|
$url = $using:url_prefix + $name
|
||||||
|
$dest = $using:destination
|
||||||
|
|
||||||
|
Write-Output " - Downloading $name"
|
||||||
|
# -s 阻止输出,避免并行输出混乱
|
||||||
|
curl -s -LO $url --output-dir $dest
|
||||||
|
Write-Output " √ Completed $name"
|
||||||
|
} -ThrottleLimit 5 # 限制同时下载5个文件
|
||||||
|
|
||||||
|
Write-Output "=> All downloads completed!"
|
||||||
|
|
||||||
Set-Location -
|
Set-Location -
|
||||||
Write-Output "=> Downloaded to $destination"
|
Write-Output "=> Downloaded to $destination"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user