mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-15 12:53:31 +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 {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string[]]$InstallDirs,
|
||||
[string[]]$SharedInstallDirs = @(),
|
||||
[AllowEmptyCollection()][AllowEmptyString()][string[]]$SharedInstallDirs = @(),
|
||||
[Parameter(Mandatory = $true)][string]$UserDataDir,
|
||||
[Parameter(Mandatory = $true)][string]$RecoveryRoot,
|
||||
[Parameter(Mandatory = $true)][string]$ProcessName,
|
||||
@ -657,8 +657,12 @@ function Invoke-LegacyRecovery {
|
||||
-UserDataDir $UserDataDir `
|
||||
-ActiveConfigDir $ActiveConfigDir `
|
||||
-ActiveConfigManaged $ActiveConfigManaged
|
||||
$potentialSharedInstallDirs = @(Get-PotentialInstallDirs -InstallDirs $SharedInstallDirs)
|
||||
$existingSharedInstallDirs = @(Get-ExistingInstallDirs -InstallDirs $potentialSharedInstallDirs)
|
||||
$sharedInstallDirInputs = @($SharedInstallDirs | Where-Object { -not [string]::IsNullOrWhiteSpace($_) })
|
||||
$existingSharedInstallDirs = @()
|
||||
if ($sharedInstallDirInputs.Count -gt 0) {
|
||||
$potentialSharedInstallDirs = @(Get-PotentialInstallDirs -InstallDirs $sharedInstallDirInputs)
|
||||
$existingSharedInstallDirs = @(Get-ExistingInstallDirs -InstallDirs $potentialSharedInstallDirs)
|
||||
}
|
||||
if ($existingSharedInstallDirs.Count -gt 0) {
|
||||
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('Test-LexicalPathAtOrBelow')
|
||||
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('untrusted-elevated')
|
||||
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