feat(ui): detect missing fzf and show installation hints
This commit is contained in:
@@ -35,6 +35,29 @@ function Test-FzfAvailable
|
||||
return [bool](Get-Command fzf -ErrorAction SilentlyContinue)
|
||||
}
|
||||
|
||||
function Show-FzfHint
|
||||
{
|
||||
if(Test-FzfAvailable) { return }
|
||||
Write-Host "`n[fzf not found]" -ForegroundColor Yellow -NoNewline
|
||||
Write-Host " Install fzf for the best interactive menu experience.`n" -ForegroundColor DarkGray
|
||||
if($IsMacOS)
|
||||
{
|
||||
Write-Host " macOS: brew install fzf" -ForegroundColor DarkGray
|
||||
}
|
||||
elseif($IsLinux)
|
||||
{
|
||||
Write-Host " Debian/Ubuntu: sudo apt install fzf" -ForegroundColor DarkGray
|
||||
Write-Host " Fedora: sudo dnf install fzf" -ForegroundColor DarkGray
|
||||
Write-Host " Arch: sudo pacman -S fzf" -ForegroundColor DarkGray
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host " Windows: winget install junegunn.fzf" -ForegroundColor DarkGray
|
||||
Write-Host " choco install fzf" -ForegroundColor DarkGray
|
||||
}
|
||||
Write-Host " (Falling back to numbered menus for now.)`n" -ForegroundColor DarkGray
|
||||
}
|
||||
|
||||
function Show-FzfMenu
|
||||
{
|
||||
param(
|
||||
@@ -263,6 +286,8 @@ if(-not $currentTenant -or -not $currentTenant.TenantName)
|
||||
}
|
||||
#endregion
|
||||
|
||||
Show-FzfHint
|
||||
|
||||
# Build common parameter hashtable
|
||||
$commonParams = @{
|
||||
TenantId = $TenantId
|
||||
|
||||
Reference in New Issue
Block a user