上传文件至 /

main
Cypress_Ik727 2024-03-19 12:49:20 +00:00
parent bf7d8a1a2f
commit 63f258d034
1 changed files with 29 additions and 0 deletions

29
package.ps1 Normal file
View File

@ -0,0 +1,29 @@
param (
[switch]$NoArchive,
[string]$OutputDirectory = $PSScriptRoot
)
Set-Location "$PSScriptRoot"
$FilesToInclude = "info.json","build/*","LICENSE","assetbundles"
$modInfo = Get-Content -Raw -Path "info.json" | ConvertFrom-Json
$modId = $modInfo.Id
$modVersion = $modInfo.Version
$DistDir = "$OutputDirectory/dist"
if ($NoArchive) {
$ZipWorkDir = "$OutputDirectory"
} else {
$ZipWorkDir = "$DistDir/tmp"
}
$ZipOutDir = "$ZipWorkDir/$modId"
New-Item "$ZipOutDir" -ItemType Directory -Force
Copy-Item -Force -Path $FilesToInclude -Destination "$ZipOutDir"
Copy-Item -Force -Path "assetbundles/*" -Destination "$ZipOutDir/assetbundles"
if (!$NoArchive)
{
$FILE_NAME = "$DistDir/${modId}_v$modVersion.zip"
Compress-Archive -Update -CompressionLevel Fastest -Path "$ZipOutDir/*" -DestinationPath "$FILE_NAME"
}