dx(win): fix codegen.ps1 on

This commit is contained in:
dave caruso
2023-12-19 13:29:31 -08:00
parent 3f131c0411
commit ab68aa5a8e

View File

@@ -1,10 +1,15 @@
param(
[Alias("o")]$OutDir = "build"
)
$Script1=(Join-Path $PSScriptRoot "./cross-compile-codegen.sh")
$CrossCompileCodegen=(Get-Content $Script1 -Raw)
$CrossCompileCodegen.Replace("`r`n","`n") | Set-Content $Script1 -Force -NoNewline
$Script2=(Join-Path $PSScriptRoot "../src/codegen/create_hash_table")
$CreateHashTable=(Get-Content $Script2 -Raw)
$CreateHashTable.Replace("`r`n","`n") | Set-Content $Script2 -Force -NoNewline
$Script=(Join-Path $PSScriptRoot "./cross-compile-codegen.sh")
(Get-Content $Script -Raw).Replace("`r`n","`n") | Set-Content $Script -Force -NoNewline
$Script=(Join-Path $PSScriptRoot "../src/codegen/create_hash_table")
(Get-Content $Script -Raw).Replace("`r`n","`n") | Set-Content $Script -Force -NoNewline
& 'C:\Program Files\WSL\wsl.exe' ./scripts/cross-compile-codegen.sh win32 x64 "build"
wsl ./scripts/cross-compile-codegen.sh win32 x64 "$OutDir"
Set-Content $Script1 -Force -NoNewline -Value $CrossCompileCodegen
Set-Content $Script2 -Force -NoNewline -Value $CreateHashTable
# copy into build-release as well
Copy-Item -Path "build/codegen" -Destination "build-release/codegen" -Recurse -Force
Copy-Item -Path "build/js" -Destination "build-release/codegen" -Recurse -Force