Trim whitespace when parsing SteamAppId

This commit is contained in:
Alex Smith
2025-08-26 22:15:35 +05:00
parent fd9df57242
commit 97b6d58b03

View File

@@ -86,7 +86,7 @@ getSteamId() {
local file=$(find "$(dirname "${NOSTAPPPATH}")" -type f \( ${conditions# -o} \) -print -quit 2>/dev/null) local file=$(find "$(dirname "${NOSTAPPPATH}")" -type f \( ${conditions# -o} \) -print -quit 2>/dev/null)
if [[ -n "${file}" ]]; then if [[ -n "${file}" ]]; then
if [[ "${file}" == *"steam_appid.txt" ]]; then if [[ "${file}" == *"steam_appid.txt" ]]; then
SteamAppId=$(cat "${file}" | tr -d '\r\n') SteamAppId=$(cat "${file}" | tr -d '[:space:]\r\n')
else else
SteamAppId=$(grep -i "^AppId=" "${file}" | cut -d'=' -f2 | head -1 | tr -d '\r\n') SteamAppId=$(grep -i "^AppId=" "${file}" | cut -d'=' -f2 | head -1 | tr -d '\r\n')
fi fi