From 27263411ba0f8315686f2b43919995aa892fde1c Mon Sep 17 00:00:00 2001 From: rickpeters Date: Tue, 13 Oct 2026 20:23:04 +0200 Subject: [PATCH] gamescope-nvidia: glob instead of ls | grep (shellcheck SC2010) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01KkpbsMw4rQyBsxDG6ebHK2 --- lib/gamescope-nvidia.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/gamescope-nvidia.sh b/lib/gamescope-nvidia.sh index 494af09..e6e6026 100644 --- a/lib/gamescope-nvidia.sh +++ b/lib/gamescope-nvidia.sh @@ -160,8 +160,11 @@ gsn_build_package() { rm -rf "$dir"; return 1 fi # Moved out, so the build folder can go. - mv "$(ls "$dir"/"$GSN_PKG"-*.pkg.tar.* 2>/dev/null | grep -v -- '-debug-' | head -1)" "$cache/gamescope-local-build.pkg.tar.zst" || - { rm -rf "$dir"; return 1; } + local f built="" + for f in "$dir"/"$GSN_PKG"-*.pkg.tar.*; do + [[ -e "$f" && "$f" != *-debug-* ]] && { built="$f"; break; } + done + [[ -n "$built" ]] && mv "$built" "$cache/gamescope-local-build.pkg.tar.zst" || { rm -rf "$dir"; return 1; } rm -rf "$dir" echo "$cache/gamescope-local-build.pkg.tar.zst" }