diff --git a/requirements.ps1 b/requirements.ps1 index 982120b..6c66119 100644 --- a/requirements.ps1 +++ b/requirements.ps1 @@ -24,7 +24,11 @@ param ( [Alias('no-npm')] [switch]$NoNpm, [Alias('only-npm')] - [switch]$OnlyNpm + [switch]$OnlyNpm, + [Alias('no-fonts')] + [switch]$NoFonts, + [Alias('only-fonts')] + [switch]$OnlyFonts ) if ($Help) @@ -69,6 +73,7 @@ $Flags = [ordered]@{ PowershellEnabled = -not $NoPowershell PipEnabled = -not $NoPip NpmEnabled = -not $NoNpm + FontsEnabled = -not $NoFonts } function Reset-Flags @@ -109,6 +114,11 @@ if ($OnlyNpm) Reset-Flags $Flags.NpmEnabled = $true } +if ($OnlyFonts) +{ + Reset-Flags + $Flags.FontsEnabled = $true +} Write-Host "These providers are enabled:" foreach ($key in $Flags.Keys) @@ -205,5 +215,25 @@ if ($Flags.PowershellEnabled) Install-Module posh-git -Scope CurrentUser -Force } +if ($Flags.FontsEnabled) +{ + Write-Divider + Write-Host "Installing Fonts" + Set-Location ~ + Remove-Item ~\fonts | Out-Null + wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/JetBrainsMono.zip + mkdir ~\fonts + Copy-Item ~\JetBrainsMono.zip ~\fonts\JetBrainsMono.zip + Set-Location ~\fonts | Out-Null + unzip JetBrainsMono.zip + Remove-Item JetBrainsMono.zip + $UserFonts = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts" + New-Item -ItemType Directory -Path $UserFonts -Force | Out-Null + Get-ChildItem -Filter *.ttf | ForEach-Object { + Invoke-Item $_.FullName + } + Set-Location ~ +} + Write-Divider Write-Host "Done!"