-
Notifications
You must be signed in to change notification settings - Fork 34
/
FiraCode-NF-Mono.json
71 lines (71 loc) · 4.46 KB
/
FiraCode-NF-Mono.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"version": "2.3.3",
"description": "Nerd Fonts patched 'FiraCode' Font family. (Monospace version, Nerd Fonts Symbol/Icon will be always 1 cell wide)",
"homepage": "https://github.com/ryanoasis/nerd-fonts",
"license": "MIT",
"url": "https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/FiraCode.zip",
"hash": "12c58f67731354f78e1a55030954bd326e380d1726c7f96f3db1089d53ecf609",
"installer": {
"script": [
"$currentBuildNumber = [int] (Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\").CurrentBuildNumber",
"$windows11Version22H2BuildNumber = 22621",
"$doesPerUserFontInstallationHaveIssue = $currentBuildNumber -ge $windows11Version22H2BuildNumber",
"if ($doesPerUserFontInstallationHaveIssue -and !$global) {",
" scoop uninstall $app",
" Write-Host \"\"",
" Write-Host \"Currently, on Windows 11 Version 22H2 (OS Build 22621) or later,\" -Foreground DarkRed",
" Write-Host \"Font installation only works when installing font for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \"Please use following commands to install '$app' Font for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \" scoop install sudo\"",
" Write-Host \" sudo scoop install -g $app\"",
" Write-Host \"\"",
" Write-Host \"See https://github.com/matthewjberger/scoop-nerd-fonts/issues/198 for more details.\" -Foreground Magenta",
" exit 1",
"}",
"$windows10Version1809BuildNumber = 17763",
"$isPerUserFontInstallationSupported = $currentBuildNumber -ge $windows10Version1809BuildNumber",
"if (!$isPerUserFontInstallationSupported -and !$global) {",
" scoop uninstall $app",
" Write-Host \"\"",
" Write-Host \"For Windows version before Windows 10 Version 1809 (OS Build 17763),\" -Foreground DarkRed",
" Write-Host \"Font can only be installed for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \"Please use following commands to install '$app' Font for all users.\" -Foreground DarkRed",
" Write-Host \"\"",
" Write-Host \" scoop install sudo\"",
" Write-Host \" sudo scoop install -g $app\"",
" Write-Host \"\"",
" exit 1",
"}",
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"$registryRoot = if ($global) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"New-Item $fontInstallDir -ItemType Directory -ErrorAction SilentlyContinue | Out-Null",
"Get-ChildItem $dir -Filter '*Mono Windows Compatible*' | ForEach-Object {",
" $value = if ($global) { $_.Name } else { \"$fontInstallDir\\$($_.Name)\" }",
" New-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Value $value -Force | Out-Null",
" Copy-Item $_.FullName -Destination $fontInstallDir",
"}"
]
},
"uninstaller": {
"script": [
"$fontInstallDir = if ($global) { \"$env:windir\\Fonts\" } else { \"$env:LOCALAPPDATA\\Microsoft\\Windows\\Fonts\" }",
"$registryRoot = if ($global) { \"HKLM\" } else { \"HKCU\" }",
"$registryKey = \"${registryRoot}:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\"",
"Get-ChildItem $dir -Filter '*Mono Windows Compatible*' | ForEach-Object {",
" Remove-ItemProperty -Path $registryKey -Name $_.Name.Replace($_.Extension, ' (TrueType)') -Force -ErrorAction SilentlyContinue",
" Remove-Item \"$fontInstallDir\\$($_.Name)\" -Force -ErrorAction SilentlyContinue",
"}",
"if ($cmd -eq \"uninstall\") {",
" Write-Host \"The '$($app.Replace('-NF', ''))' Font family has been uninstalled and will not be present after restarting your computer.\" -Foreground Magenta",
"}"
]
},
"checkver": "github",
"autoupdate": {
"url": "https://github.com/ryanoasis/nerd-fonts/releases/download/v$version/FiraCode.zip"
}
}