This changes the launcher.sh bash script and fixes updating and finding a terminal.
The broken updating was caused by the script being in the SillyTavern subdirectory because of cd'ing into it at line 136, as well as incorrect cd parameters in the update function after finding the directory because if we are already in the script's directory $(dirname "$0") outputs ., I also simplified the if statements in the update() function and made it cd out back to the main SillyTavern-Launcher so it can proceed with the next update step.
The seldom working terminal finding which always fell back to xterm was caused by the script looking at the $TERMINAL env var, I added to the find_terminal() function so that it also looks in the much more common $TERM env var first and then in $TERMINAL.
It also fixes random issues that I find that shouldn't happen but happen because of one reason or another.
This changes the launcher.sh bash script and fixes updating and finding a terminal.
The broken updating was caused by the script being in the SillyTavern subdirectory because of cd'ing into it at line 136, as well as incorrect cd parameters in the update function after finding the directory because if we are already in the script's directory
$(dirname "$0")
outputs.
, I also simplified the if statements in the update() function and made it cd out back to the main SillyTavern-Launcher so it can proceed with the next update step.The seldom working terminal finding which always fell back to xterm was caused by the script looking at the $TERMINAL env var, I added to the find_terminal() function so that it also looks in the much more common $TERM env var first and then in $TERMINAL.
It also fixes random issues that I find that shouldn't happen but happen because of one reason or another.