Files
spectre.console/resources/scripts/Generate-Emoji.ps1
2025-12-24 20:17:42 +01:00

25 lines
786 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"
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"