Added a build script
This commit is contained in:
parent
01a000b9fa
commit
441fcc76df
3 changed files with 27 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
.env
|
||||
.env
|
||||
build/
|
||||
23
build.ps1
Normal file
23
build.ps1
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env pwsh
|
||||
|
||||
. ".\common.ps1"
|
||||
|
||||
$game_name = $env:GAME_NAME ?? "game"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "./build/" | Out-Null
|
||||
tar -cf "./build/$game_name.tar" -C $(Resolve-Path "./game/") *
|
||||
|
||||
$output = "./build/$game_name.exe"
|
||||
[System.IO.File]::Copy("./lovedos/love.exe", $output, $true)
|
||||
Add-Content $output -AsByteStream -Value $(Get-Content -Raw -AsByteStream $(Resolve-Path "./build/$game_name.tar"))
|
||||
try {
|
||||
$stream = $(Get-Item $output).Open([System.IO.FileMode]::Append)
|
||||
$writer = [System.IO.BinaryWriter]::new($stream)
|
||||
|
||||
$tar = Get-Item "./build/$game_name.tar"
|
||||
$writer.Write([Char[]] ('T', 'A', 'R', 0))
|
||||
$writer.Write([Int32] ($tar.Length + 8))
|
||||
} finally {
|
||||
$writer.Dispose()
|
||||
$stream.Dispose()
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
LOVE2D_EXE=C:/Program Files/LOVE/love.exe
|
||||
DOSBOX_X_EXE=C:/DOSBox-X/dosbox-x.exe
|
||||
DOSBOX_X_CPU=pentium_ii
|
||||
DOSBOX_X_CPU=pentium_ii
|
||||
GAME_NAME=example
|
||||
Loading…
Add table
Add a link
Reference in a new issue