mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-31 16:33:34 +08:00
fix(desktop): skip empty shared install scans
This commit is contained in:
parent
5dcf9b80d4
commit
73a4aef95f
@ -636,7 +636,7 @@ function Write-AppModeAtomically {
|
|||||||
function Invoke-LegacyRecovery {
|
function Invoke-LegacyRecovery {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $true)][string[]]$InstallDirs,
|
[Parameter(Mandatory = $true)][string[]]$InstallDirs,
|
||||||
[string[]]$SharedInstallDirs = @(),
|
[AllowEmptyCollection()][AllowEmptyString()][string[]]$SharedInstallDirs = @(),
|
||||||
[Parameter(Mandatory = $true)][string]$UserDataDir,
|
[Parameter(Mandatory = $true)][string]$UserDataDir,
|
||||||
[Parameter(Mandatory = $true)][string]$RecoveryRoot,
|
[Parameter(Mandatory = $true)][string]$RecoveryRoot,
|
||||||
[Parameter(Mandatory = $true)][string]$ProcessName,
|
[Parameter(Mandatory = $true)][string]$ProcessName,
|
||||||
@ -657,8 +657,12 @@ function Invoke-LegacyRecovery {
|
|||||||
-UserDataDir $UserDataDir `
|
-UserDataDir $UserDataDir `
|
||||||
-ActiveConfigDir $ActiveConfigDir `
|
-ActiveConfigDir $ActiveConfigDir `
|
||||||
-ActiveConfigManaged $ActiveConfigManaged
|
-ActiveConfigManaged $ActiveConfigManaged
|
||||||
$potentialSharedInstallDirs = @(Get-PotentialInstallDirs -InstallDirs $SharedInstallDirs)
|
$sharedInstallDirInputs = @($SharedInstallDirs | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
|
||||||
$existingSharedInstallDirs = @(Get-ExistingInstallDirs -InstallDirs $potentialSharedInstallDirs)
|
$existingSharedInstallDirs = @()
|
||||||
|
if ($sharedInstallDirInputs.Count -gt 0) {
|
||||||
|
$potentialSharedInstallDirs = @(Get-PotentialInstallDirs -InstallDirs $sharedInstallDirInputs)
|
||||||
|
$existingSharedInstallDirs = @(Get-ExistingInstallDirs -InstallDirs $potentialSharedInstallDirs)
|
||||||
|
}
|
||||||
if ($existingSharedInstallDirs.Count -gt 0) {
|
if ($existingSharedInstallDirs.Count -gt 0) {
|
||||||
Assert-NoUndiscoveredLegacySources -InstallDirs $existingSharedInstallDirs -ActiveSource $source
|
Assert-NoUndiscoveredLegacySources -InstallDirs $existingSharedInstallDirs -ActiveSource $source
|
||||||
}
|
}
|
||||||
|
|||||||
@ -532,6 +532,7 @@ describe('release desktop workflow', () => {
|
|||||||
expect(recoveryHelper).toContain('Active CLAUDE_CONFIG_DIR is managed outside Claude Code Haha')
|
expect(recoveryHelper).toContain('Active CLAUDE_CONFIG_DIR is managed outside Claude Code Haha')
|
||||||
expect(recoveryHelper).toContain('Test-LexicalPathAtOrBelow')
|
expect(recoveryHelper).toContain('Test-LexicalPathAtOrBelow')
|
||||||
expect(recoveryHelper).toContain('-SharedInstallDirs @($PerMachineInstallDir)')
|
expect(recoveryHelper).toContain('-SharedInstallDirs @($PerMachineInstallDir)')
|
||||||
|
expect(recoveryHelper).toContain('$sharedInstallDirInputs.Count -gt 0')
|
||||||
expect(recoveryHelper).toContain('per-user default-mode reinstall scanned the packaged application tree')
|
expect(recoveryHelper).toContain('per-user default-mode reinstall scanned the packaged application tree')
|
||||||
expect(recoveryHelper).toContain('untrusted-elevated')
|
expect(recoveryHelper).toContain('untrusted-elevated')
|
||||||
expect(recoveryHelper).toContain('External CLAUDE_CONFIG_DIR is active while install-contained legacy data still exists')
|
expect(recoveryHelper).toContain('External CLAUDE_CONFIG_DIR is active while install-contained legacy data still exists')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user