File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1-
2- @ {
1+ @ {
32 ' nf-custom-c' = ' '
43 ' nf-custom-cpp' = ' '
54 ' nf-custom-electron' = ' '
Original file line number Diff line number Diff line change @@ -13,6 +13,32 @@ task default -depends Test
1313
1414task Pester - FromModule PowerShellBuild - Version ' 0.6.1' - preaction {Remove-Module Terminal- Icons - ErrorAction SilentlyContinue}
1515
16+ task UpdateGlyphs {
17+ Import-Module PowerHtml
18+
19+ $cheatsheet = ' https://www.nerdfonts.com/cheat-sheet'
20+ $parsedHtml = Invoke-WebRequest $cheatsheet | ConvertFrom-Html
21+ $glyphs = $parsedHtml.SelectNodes (" //div[@class='class-name']" ).ForEach ({
22+ [pscustomobject ]@ {
23+ name = $_.InnerText
24+ codePoint = $_.NextSibling [0 ].InnerText
25+ }
26+ })
27+
28+ $sb = [Text.StringBuilder ]::new()
29+ $sb.AppendLine (' @{' ) > $null
30+ $glyphs.ForEach ({
31+ $icon = [char ][int ]" 0x$ ( $_.codePoint ) "
32+ $sb.AppendFormat (" '{0}' = '{1}'`n " , $_.Name , $icon ) > $null
33+ })
34+ $sb.AppendLine (' }' ) > $null
35+
36+ $now = [int ][double ]::Parse((Get-Date - UFormat % s))
37+ $fileName = " $PSScriptRoot /Terminal-Icons/Data/glyphs_$now .ps1"
38+ $sb.ToString ().Trim() | Out-File $fileName - Encoding utf8
39+
40+ } - description ' Create a list of glyphs, sourced from nerdfonts.com'
41+
1642task InstallAct {
1743 if (-not (Get-Command - Name act - CommandType Application - ErrorAction SilentlyContinue)) {
1844 if ($IsWindows ) {
Original file line number Diff line number Diff line change 1212 }
1313 }
1414 platyPS = ' 0.14.1'
15+ PowerHtml = ' latest'
1516 PowerShellBuild = @ {
1617 RequiredVersion = ' 0.6.1'
1718 }
You can’t perform that action at this time.
0 commit comments