diff --git a/linux-game-manager.sh b/linux-game-manager.sh index c4f7622..88ee559 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -398,6 +398,9 @@ game_installer() { exit 1 fi fi + if [[ -e "${0%/*}/.launch/${game}.game" ]] && ! [[ -L "${0%/*}/.launch/${game.sh}" ]]; then + ln -srf "${0%/*}/.launch/${game}.game" "${0%/*}/.launch/${game}.sh" + fi exit 0 } @@ -443,7 +446,7 @@ game_removal() { --yesno "This will remove the directory \"${game%/*}\" and all of its contents. Do you want to continue?." -1 -1 --stdout || exit 0 fi export noRemove - { [ "$noRemove" == "no" ] && rm -rfv "${game%/*}"; + { [[ "$noRemove" == "no" ]] && rm -rfv "${game%/*}"; sed -i "/${game//\//\\/}/d" "$configFile"; } | dialog --backtitle "Linux Game Manager" --progressbox "Removing game..." -1 -1 exit 0 } @@ -493,10 +496,11 @@ game_launcher() { if [[ -d ".launch" ]]; then find "${0%/*}/.launch" -maxdepth 1 -type f -iname "*.sh" -exec bash -c ' for f; do - name="${f##*/}" - echo "${name%.sh}|$f" + [[ $(head -n1 "$f") == "#"* ]] && continue + name="${f##*/}" + echo "${name%.sh}|$f" done - ' bash {} \; + ' _ {} \; fi ) # Add all entries to menu