You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚀 [Feature]: Install only the Nerd Font variants you need with faster reruns (#77)
Install-NerdFont can now install only the Nerd Font variants you want,
reuse cached archives between runs, and skip work for fonts that are
already present in the requested scope. Multi-font installs also finish
faster because archive downloads are batched and extraction uses the
underlying .NET zip APIs directly.
- Fixes#70
- Fixes#71
- Fixes#72
- Fixes#73
- Fixes#74
- Fixes#75
- Fixes#76
## New: Install only the variants you need
Use `-Variant` to limit each archive to the families you actually want
to register. This is useful for terminal-focused setups where only the
monospace family is needed.
```powershell
Install-NerdFont -Name 'FiraCode' -Variant Mono
Install-NerdFont -All -Variant Mono
```
`All` remains the default, so existing scripts keep the current behavior
unless they opt into `Standard`, `Mono`, or `Propo`.
## Changed: Repeated installs reuse prior work
When a font is already installed in the requested scope and `-Force` is
not used, `Install-NerdFont` now skips the download, extraction, and
install phases for that font. Downloaded archives are cached per Nerd
Fonts release, so retries and overlapping reruns can reuse the same zip
instead of fetching it again.
```powershell
Install-NerdFont -Name 'Hack'
Install-NerdFont -Name 'Hack' # skips when already installed
Install-NerdFont -Name 'Hack' -Force # re-downloads and reinstalls
```
## Changed: Multi-font installs complete faster
Bulk installs now resolve the target font set once, avoid duplicate work
from overlapping name patterns, download archives in bounded batches,
and extract them with `System.IO.Compression.ZipFile`. The end result is
less waiting during `-All` and other multi-font runs without changing
the default install surface.
## Technical Details
- `Install-NerdFont` now deduplicates the resolved font list, skips
already-installed fonts without `-Force`, caches archives under the user
cache directory, downloads uncached archives through
`System.Net.Http.HttpClient`, extracts with
`System.IO.Compression.ZipFile`, and filters extracted files by
`-Variant` before calling `Install-Font`.
- `tests/NerdFonts.Tests.ps1` adds coverage for `-Variant Mono`
installs.
- `scripts/Measure-InstallPerformance.ps1` adds repeatable performance
scenarios for single-font, subset, rerun, and optional `-All`
measurements.
- `README.md` now documents variant installs, skip-on-rerun behavior,
and cache bypass with `-Force`.
- Implementation plan progress: the work tracked by #70 through #76 is
completed in this PR.
Copy file name to clipboardExpand all lines: README.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,12 @@ To download the font from the NerdFonts repository and install it on the system,
37
37
Install-NerdFont -Name 'FiraCode' -Scope AllUsers #Tab completion works on Scope too
38
38
```
39
39
40
+
To install only a specific variant from the archive, use the `-Variant` parameter. `Mono` is useful for terminal and editor setups where you only want the monospace family.
41
+
42
+
```powershell
43
+
Install-NerdFont -Name 'FiraCode' -Variant Mono
44
+
```
45
+
40
46
### Install all NerdFonts
41
47
42
48
To install all NerdFonts on the system you can use the following command.
@@ -54,6 +60,12 @@ This requires the shell to run in an elevated context (sudo or run as administra
54
60
Install-NerdFont -All -Scope AllUsers
55
61
```
56
62
63
+
You can combine `-All` with `-Variant` to limit what gets installed from each archive:
64
+
65
+
```powershell
66
+
Install-NerdFont -All -Variant Mono
67
+
```
68
+
57
69
### Check if a NerdFont is installed
58
70
59
71
The [Fonts](https://psmodule.io/Fonts) module is installed automatically as a dependency and provides the
If the command returns results, the font is installed. If it returns nothing, the font is not installed in that scope.
75
87
88
+
When you run `Install-NerdFont` again without `-Force`, fonts that are already installed in the requested scope are skipped. Downloaded archives are also cached per Nerd Fonts release so retries and repeated installs do not need to fetch the same ZIP again.
This re-downloads and installs the font version bundled with your installed NerdFonts module, overwriting any existing
92
-
files. To pick up newer font releases, update the NerdFonts module first (`Update-PSResource -Name NerdFonts` if you
121
+
files. `-Force` also bypasses the local archive cache so the font ZIP is fetched again before reinstalling. To pick up newer font releases, update the NerdFonts module first (`Update-PSResource -Name NerdFonts` if you
93
122
installed via PSResourceGet, or `Update-Module -Name NerdFonts` if you installed via PowerShellGet).
0 commit comments