From 92745d8af8c07f7a4704f1cdbc382e1be12cca09 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 5 May 2026 02:38:10 -0400 Subject: [PATCH] Fix Shadow Line translation line endings --- .includes/proton.sh | 7 +++++++ .install/Shadow Line.sh | 2 +- tests/umu_backend_tests.sh | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.includes/proton.sh b/.includes/proton.sh index 2c8c65d..91d19b4 100644 --- a/.includes/proton.sh +++ b/.includes/proton.sh @@ -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 diff --git a/.install/Shadow Line.sh b/.install/Shadow Line.sh index 03db9d4..cd04a8d 100644 --- a/.install/Shadow Line.sh +++ b/.install/Shadow Line.sh @@ -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" "{}" \; diff --git a/tests/umu_backend_tests.sh b/tests/umu_backend_tests.sh index 051d160..5694f61 100644 --- a/tests/umu_backend_tests.sh +++ b/tests/umu_backend_tests.sh @@ -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'