mirror of
https://github.com/Baipyrus/dotfiles.git
synced 2024-12-26 03:11:45 +00:00
bugfix: force overwrite, create fonts directory
This commit is contained in:
parent
7c86d72ece
commit
406367b2eb
@ -189,7 +189,7 @@ function InstallNerdFont
|
|||||||
|
|
||||||
# Extract contents of zip archive
|
# Extract contents of zip archive
|
||||||
Write-Host "Extracting archive $source to $destination..." -ForegroundColor Cyan
|
Write-Host "Extracting archive $source to $destination..." -ForegroundColor Cyan
|
||||||
Expand-Archive $source -DestinationPath $destination | Out-Null
|
Expand-Archive $source -DestinationPath $destination -Force | Out-Null
|
||||||
|
|
||||||
# Install extracted fonts
|
# Install extracted fonts
|
||||||
$fontFiles = Get-ChildItem -Path $destination -Include "*.ttf", "*.otf"
|
$fontFiles = Get-ChildItem -Path $destination -Include "*.ttf", "*.otf"
|
||||||
@ -213,6 +213,11 @@ function InstallFont
|
|||||||
$destination = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\"
|
$destination = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts\"
|
||||||
$regKey = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
|
$regKey = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
|
||||||
|
|
||||||
|
# Create destination directory
|
||||||
|
if (-not (Test-Path $destination))
|
||||||
|
{ New-Item -ItemType Directory -Path $destination | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
# Get Glyph
|
# Get Glyph
|
||||||
$glyph = New-Object -TypeName Windows.Media.GlyphTypeface -ArgumentList $file.FullName
|
$glyph = New-Object -TypeName Windows.Media.GlyphTypeface -ArgumentList $file.FullName
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user