Fix Shadow Line translation line endings

This commit is contained in:
Storm Dragon
2026-05-05 02:38:10 -04:00
parent 1f977bb1f4
commit 92745d8af8
3 changed files with 24 additions and 1 deletions
+7
View File
@@ -105,6 +105,13 @@ set_umu_app_winver() {
set_umu_reg_value "HKCU\\Software\\Wine\\AppDefaults\\${exeName}" "Version" "$winVersion"
}
install_crlf_file() {
local sourceFile="$1"
local destFile="$2"
mkdir -p "${destFile%/*}"
perl -pe 's/\r?\n/\r\n/' "$sourceFile" > "$destFile"
}
stop_umu_bottle() {
if command -v wineserver &> /dev/null; then
wineserver -k 2> /dev/null || true
+1 -1
View File
@@ -28,7 +28,7 @@ if [[ ! -f "${shadowLineInstallDir}/play_sr.exe" ]]; then
exit 1
fi
install -m 0644 "${cache}/language_en.dat" "${shadowLineInstallDir}/SystemData/language_en.dat"
install_crlf_file "${cache}/language_en.dat" "${shadowLineInstallDir}/SystemData/language_en.dat"
find "$shadowLineInstallDir" -type f -iname 'nvdaControllerClient32.dll' -exec cp -v "${cache}/nvdaControllerClient32.dll" "{}" \;
find "$shadowLineInstallDir" -type f -iname 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvdaControllerClient64.dll" "{}" \;
+16
View File
@@ -98,7 +98,23 @@ test_run_umu_game_uses_converted_path() {
assert_file_contains "$UMU_STUB_LOG" "${WINEPREFIX}|shadow-line|none|${WINEPREFIX}/drive_c/Program Files (x86)/GalaxyLaboratory/ShadowRine_FullVoice/play_sr.exe" "UMU launches converted exe path"
}
test_install_crlf_file_normalizes_line_endings() {
local sourceFile="${testRoot}/language_en.dat"
local destFile="${testRoot}/installed/language_en.dat"
local expectedFile="${testRoot}/expected-language_en.dat"
printf 'line one\nline two\n' > "$sourceFile"
printf 'line one\r\nline two\r\n' > "$expectedFile"
install_crlf_file "$sourceFile" "$destFile"
if ! cmp -s "$expectedFile" "$destFile"; then
printf 'FAIL: Translation file is installed with CRLF line endings\n' >&2
exit 1
fi
}
test_get_umu_bottle_sets_environment
test_add_umu_launcher_records_backend_and_game_id
test_run_umu_game_uses_converted_path
test_install_crlf_file_normalizes_line_endings
printf 'UMU backend tests passed\n'