From 9e19062cc958706d0d34679e45a9277687fce401 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 16 Dec 2020 00:16:01 -0500 Subject: [PATCH] supress error messages for nonexistent files. --- audiogame-manager.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 49c9802..0a4edbc 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -313,7 +313,7 @@ game_launcher() { --no-tags \ --menu "Please select a game to play" 0 0 0 "${menuList[@]}" --stdout)" else - local game="$(grep "^${1}|" "${configFile}")" + local game="$(grep "^${1}|" "${configFile}" 2> /dev/null)" game="${game%|*}" if [[ -z "$game" ]]; then echo "Game $1 not found." @@ -368,7 +368,7 @@ game_launcher() { add_launcher() { local launchSettings="${game,,}" launchSettings="${launchSettings//[[:space:]]/-}|${1}|${game}" - if ! grep -F -q -x "${launchSettings}" "${configFile}" ; then + if ! grep -F -q -x "${launchSettings}" "${configFile}" 2> /dev/null ; then echo "${launchSettings}" >> "${configFile}" sort -o "${configFile}" "${configFile}" # Remove .lnk files because they don't work.