Files
spectre.console/resources/scripts/Generate-Emoji.ps1
Patrik Svensson 45799107a3 Remove Spectre.Console.Cli from repository
* Move Spectre.Console.Cli to its own repository
* Update build script to use Cake.Sdk and .NET Make
* Remove StyleCop (unmaintained)
* Add linting using dotnet format
* Fix generator which was broken
* Update dependencies
2025-11-12 20:56:48 +01:00

27 lines
921 B
PowerShell
Executable File

#!/usr/local/bin/pwsh
##########################################################
# Script that generates the emoji lookup table.
##########################################################
$Output = Join-Path $PSScriptRoot "Temp"
$Generator = Join-Path $PSScriptRoot "/../../src/Generator"
$Source = Join-Path $PSScriptRoot "/../../src/Spectre.Console"
$Docs = Join-Path $PSScriptRoot "/../../docs/src/Data"
if(!(Test-Path $Output -PathType Container)) {
New-Item -ItemType Directory -Path $Output | Out-Null
}
# Generate the files
Push-Location $Generator
&dotnet run -- emoji "$Output" --input $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"
Copy-Item (Join-Path "$Output" "emojis.json") -Destination "$Docs/emojis.json"