mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-05 03:58:16 +08:00
Add Generator command to generate emoji lookup table
This commit is contained in:

committed by
Patrik Svensson

parent
11d331e31d
commit
a7b7d4e556
22
resources/scripts/Generate-Emoji.ps1
Normal file
22
resources/scripts/Generate-Emoji.ps1
Normal file
@ -0,0 +1,22 @@
|
||||
##########################################################
|
||||
# Script that generates the emoji lookup table.
|
||||
##########################################################
|
||||
|
||||
$Output = Join-Path $PSScriptRoot "Temp"
|
||||
$Source = Join-Path $PSScriptRoot "/../../src/Spectre.Console"
|
||||
|
||||
if(!(Test-Path $Output -PathType Container)) {
|
||||
New-Item -ItemType Directory -Path $Output | Out-Null
|
||||
}
|
||||
|
||||
# Generate the files
|
||||
Push-Location Generator
|
||||
&dotnet run -- emoji "$Output"
|
||||
if(!$?) {
|
||||
Pop-Location
|
||||
Throw "An error occured when generating code."
|
||||
}
|
||||
Pop-Location
|
||||
|
||||
# Copy the files to the correct location
|
||||
Copy-Item (Join-Path "$Output" "Emoji.Generated.cs") -Destination "$Source/Emoji.Generated.cs"
|
Reference in New Issue
Block a user