Skip to content

Commit

Permalink
fix exit
Browse files Browse the repository at this point in the history
  • Loading branch information
jpawlowski committed Aug 28, 2024
1 parent 3af2635 commit da13109
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/powershell-extended/Install-NerdFont.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,11 @@ begin {
do {
$Name = Show-Menu -Options $allNerdFonts
if ($Name -eq 'quit') {
$Name = $null
Write-Host "Selection process canceled."
if ($null -eq $MyInvocation.InvocationName -or $MyInvocation.InvocationName -eq '&') {
# Running as a script block
return
break
}
else {
# Running as a standalone script
Expand All @@ -805,7 +806,6 @@ begin {
}
}
else {
Write-Host 'No font selected.'
if ($null -eq $MyInvocation.InvocationName -or $MyInvocation.InvocationName -eq '&') {
# Running as a script block
return
Expand Down Expand Up @@ -1058,15 +1058,15 @@ process {
}

$fontRegistryValue = $fontRegistryValues | Where-Object { $_.FileName -eq $fontFile.Name }
if ($fontRegistryValue) {
if ($fontRegistryValue.Count -gt 0) {
$fontOwnedByApp = $true
Write-Verbose "Font file $($fontFile.Name) already registered by application: $(Split-Path -Path $fontRegistryKey.Name -Leaf)"
continue
}
}
}

if ($fontOwnedByApp) { continue }
if ($fontOwnedByApp) { continue }
}

$fontFileDestinationPath = [System.IO.Path]::Combine($fontDestinationFolderPath, $fontFile.Name)
if (-not $Force -and (Test-Path -Path $fontFileDestinationPath)) {
Expand Down

0 comments on commit da13109

Please sign in to comment.