HereInPlainSight / gshade_installer

GShade Installer / Updater Bash Script for Linux
GNU General Public License v3.0
59 stars 18 forks source link

Check that all game paths exist, and remove missing ones #7

Closed Maia-Everett closed 3 years ago

Maia-Everett commented 3 years ago

When trying to update GShade using the latest gshade_installer, I encountered a problem: the first line in games.db was empty and the second one pointed to a directory I deleted, so the script just exited with an error.

I've improved it to check for nonexistent game directories when listing games and to prune them from games.db.

I've also moved ((++i)) to its own line, so it's more obvious that actual uses of i start with 1 rather than 0 in both loops. (You could merge the two loops into one, but I thought it was cleaner and less error-prone this way.)

HereInPlainSight commented 3 years ago

Perfect -- thank you. And you fixed a long-standing problem in that for some reason on some installations sometimes when the moon is right... there's a blank line in games.db.

I also forgot I even put that ++i inline with gamesList -- you're right, that's way better kept outside the rest of that mess. Thanks!