supress error messages for nonexistent files.

This commit is contained in:
Storm Dragon 2020-12-16 00:16:01 -05:00
parent 5650414e3c
commit 9e19062cc9

View File

@ -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.