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.