From 5ac415801c1331f2c8e859ae69d47b6b70f4a4f8 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Tue, 15 Jul 2025 07:57:14 +0800 Subject: [PATCH] Fix destination --- tool/download-pre-on-GitHub.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tool/download-pre-on-GitHub.ps1 b/tool/download-pre-on-GitHub.ps1 index 7aa2fe3..2c8470f 100644 --- a/tool/download-pre-on-GitHub.ps1 +++ b/tool/download-pre-on-GitHub.ps1 @@ -4,7 +4,7 @@ # File Name : download-pre-on-GitHub.ps1 # File Authors : Aoran Zeng # Created On : <2023-09-21> -# Last Modified : <2025-07-13> +# Last Modified : <2025-07-15> # # Download all files from the `pre` release on GitHub: # https://github.com/RubyMetric/chsrc/releases/tag/pre @@ -14,7 +14,8 @@ $destination = "~\Desktop\chsrc-pre-on-GitHub" Write-Output "=> Mkdir $destination" mkdir -Force $destination | Out-Null -Set-Location $destination + +$destination = (Resolve-Path $destination).Path $names = @( 'chsrc-x64-windows.exe' @@ -40,11 +41,11 @@ $names | ForEach-Object -Parallel { 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 - Write-Output "=> Downloaded to $destination"