Better output
Some checks are pending
Publish AUR Package (chsrc-git) / publish (push) Waiting to run

This commit is contained in:
Aoran Zeng 2024-12-08 00:37:12 +08:00
parent f1e57b2470
commit 67380177cf
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98

View File

@ -5,7 +5,7 @@
# Contributors : Aoran Zeng <ccmywish@qq.com> # Contributors : Aoran Zeng <ccmywish@qq.com>
# | # |
# Created On : <2024-10-26> # Created On : <2024-10-26>
# Last Modified : <2024-12-07> # Last Modified : <2024-12-08>
# #
# chsrc installer for Windows # chsrc installer for Windows
# --------------------------------------------------------------- # ---------------------------------------------------------------
@ -127,7 +127,7 @@ function Set_URL {
output_error "Unsupported architecture '$cpuArchitecture'. Only x86 or x64 architectures are supported." output_error "Unsupported architecture '$cpuArchitecture'. Only x86 or x64 architectures are supported."
} }
} }
output_info "My CPU architecture: $global:arch" output_info "Get my CPU architecture: $global:arch"
# Set URL # Set URL
if ($version -eq "pre") { if ($version -eq "pre") {
@ -139,7 +139,7 @@ function Set_URL {
"v" + "${global:version}/chsrc-${global:arch}-windows.exe" "v" + "${global:version}/chsrc-${global:arch}-windows.exe"
} }
output_info "Set downLoad URL: $global:url" output_info "Set download URL: $global:url"
} }
function Install { function Install {
@ -161,10 +161,10 @@ function Install {
try { try {
$outfile = "\${binary_name}.exe" $outfile = "\${binary_name}.exe"
output_info "Downloading $binary_name ($global:arch architecture, $platform platform, version $global:version) to $global:install_dir ..." output_info "Downloading $binary_name (architecture: $global:arch, platform: $platform, version: $global:version) to $global:install_dir"
Invoke-WebRequest -OutFile ($global:install_dir + $outfile) -Uri $global:url -ErrorAction Stop Invoke-WebRequest -OutFile ($global:install_dir + $outfile) -Uri $global:url -ErrorAction Stop
# 🎉 这个符号会变成 ??? 不要添加 # 🎉 这个符号会变成 ??? 不要添加
output_info "Installation completed, destination: " ($global:install_dir + $outfile) output_info "Installation completed, destination:" ($global:install_dir + $outfile)
} catch { } catch {
output_error "Unable to download $binary_name. Error: $_" output_error "Unable to download $binary_name. Error: $_"
} }