fix(package): zip paths use / so the translation files survive extraction
Compress-Archive on Windows PowerShell 5.1 wrote the entries as Translations\English\items.json. The zip format only allows /, so on Linux and Steam Deck each text file came out as one flat file with backslashes in its name, Jotunn found no Translations folder and every mod text showed as [key]. The zips are now built by scripts/package.ps1.
This commit is contained in:
parent
19d331789a
commit
6b020fb80a
2 changed files with 61 additions and 11 deletions
|
|
@ -153,18 +153,10 @@
|
|||
<PackageOutputDir>$(REPO_ROOT)dist\</PackageOutputDir>
|
||||
</PropertyGroup>
|
||||
<MakeDir Directories="$(PackageOutputDir)" Condition="!Exists('$(PackageOutputDir)')" />
|
||||
<!-- Nexus users unzip straight into plugins, so the texts travel inside a RacesOfValheim
|
||||
folder there; Thunderstore already gives every package a folder of its own. -->
|
||||
<PropertyGroup>
|
||||
<NexusStaging>$(IntermediateOutputPath)nexus\</NexusStaging>
|
||||
</PropertyGroup>
|
||||
<RemoveDir Directories="$(NexusStaging)" />
|
||||
<Copy SourceFiles="@(TranslationFile)" DestinationFiles="@(TranslationFile->'$(NexusStaging)RacesOfValheim\Translations\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Message Text="Packaging Thunderstore and Nexus zips into $(PackageOutputDir)" Importance="high" />
|
||||
<!-- The version is read back out of manifest.json rather than duplicated here, so
|
||||
manifest.json stays the single place a release is numbered. Written with string
|
||||
concatenation because MSBuild would eat a PowerShell $(...) subexpression. -->
|
||||
<Exec Command="powershell -NoProfile -Command "$v = (Get-Content '$(ProjectDir)..\manifest.json' -Raw | ConvertFrom-Json).version_number; Compress-Archive -Path '$(TargetDir)$(TargetName).dll', '$(ProjectDir)..\manifest.json', '$(ProjectDir)..\README.md', '$(ProjectDir)Package\icon.png', '$(ProjectDir)Translations' -DestinationPath ('$(PackageOutputDir)RacesOfValheim_Thunderstore_' + $v + '.zip') -Force; Compress-Archive -Path '$(TargetDir)$(TargetName).dll', '$(NexusStaging)RacesOfValheim' -DestinationPath ('$(PackageOutputDir)RacesOfValheim_Nexus_' + $v + '.zip') -Force"" />
|
||||
<!-- A script rather than Compress-Archive, which writes zip paths with backslashes: see
|
||||
scripts\package.ps1. -->
|
||||
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File "$(ProjectDir)..\scripts\package.ps1" -Dll "$(TargetDir)$(TargetName).dll" -Manifest "$(ProjectDir)..\manifest.json" -Readme "$(ProjectDir)..\README.md" -Icon "$(ProjectDir)Package\icon.png" -Translations "$(ProjectDir)Translations" -OutDir "$(REPO_ROOT)dist"" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue