Fix Shadow Line translation line endings
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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" "{}" \;
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user