fix: move detect_installed after setup_install_dir to avoid empty Test-Path error
This commit is contained in:
+1
-1
@@ -1190,13 +1190,13 @@ if ($Upgrade -or $Force -or $Source -or $SkipHub -or $InstallDir -or $isIexExecu
|
||||
Write-Host "║ HAPI 快速模式 ║" -ForegroundColor White
|
||||
Write-Host "╚══════════════════════════════════════════════════════════════════╝" -ForegroundColor White
|
||||
Write-Host ""
|
||||
Setup-InstallDir
|
||||
Detect-Installed
|
||||
if ($script:INSTALLED_VERSION) {
|
||||
$srcDisplay = $script:INSTALLED_SOURCE
|
||||
if ($srcDisplay -like "github:*") { $srcDisplay = $srcDisplay.Substring(7) }
|
||||
Write-Info "检测到已安装 HAPI CLI v$($script:INSTALLED_VERSION) (来源: $srcDisplay, 路径: $((Get-Command hapi -ErrorAction SilentlyContinue).Source))"
|
||||
}
|
||||
Setup-InstallDir
|
||||
Check-Prerequisites
|
||||
Run-QuickMode
|
||||
exit 0
|
||||
|
||||
+1
-1
@@ -1392,6 +1392,7 @@ check_prerequisites() {
|
||||
# 快速模式:向后兼容的命令行参数
|
||||
# ─────────────────────────────────────────
|
||||
run_quick_mode() {
|
||||
setup_install_dir
|
||||
detect_installed
|
||||
|
||||
if [[ -n "$INSTALLED_VERSION" ]]; then
|
||||
@@ -1402,7 +1403,6 @@ run_quick_mode() {
|
||||
info "检测到已安装 HAPI CLI v$INSTALLED_VERSION (来源: $src_display, 路径: $actual_path)"
|
||||
fi
|
||||
|
||||
setup_install_dir
|
||||
check_prerequisites
|
||||
|
||||
SELECTED_SOURCE=""
|
||||
|
||||
Reference in New Issue
Block a user