uranium_things/pack.ps1

31 lines
607 B
PowerShell
Raw Normal View History

2024-11-04 10:11:40 +01:00
#
#
#
#
New-Item -ItemType Directory -Force -Path dist
$7zipPath = "$env:ProgramFiles\7-Zip\7z.exe"
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
throw "7 zip executable '$7zipPath' not found"
}
Set-Alias Start-SevenZip $7zipPath
Write-Host "PACK MOD"
$code = Get-Content .\src\info.json -Raw | ConvertFrom-Json
$name = $code.name + "_" + $code.version
Write-Host ("Packing as $name")
rm tmp -r -force
mkdir tmp
cp -r src tmp
cp README.md tmp/src
mv "tmp/src" "tmp/$name"
cd tmp
Start-SevenZip a -tzip "../dist/$name.zip" "./$name"
cd ..
2024-11-02 04:36:12 +01:00
rm tmp -r -force