I also wrote my own Python based installer, updater, manager of Proton GE (but do not post it here, as this is about your project and not mine). Years back when I posted it, people pointed out such a cli tool already existed: protonup. And for those who want a GUI, protonup-qt exists too.
rm -r $tempdir
This is extremely dangerous command! If anything goes wrong for whatever reason and the variable $tempdir is empty at the time of this command, then it would delete everything. At the very least you should do a check if variable is not empty and resolves to an existing directory. Better yet, make it multiple steps:
- check if variable is not empty
- check if variable resolves to a directory
- cd into the directory and delete content by name instead a variable, like
rm -r GE-Proton*and then cd .. back and delete empty directory withrmdir $tempdir
This is a more controlled way of deleting files. I admit that I am a bit paranoid with rm -r commands.