[Bug Report] Macos does not see config.txt
Bug Description
On the latest macos I put .jar and config.txt in the same folder. It searches it somewhere it does not exist (path for me: /private/var/folders/57/6j1h_z_j7x18015xs05w4wwh0000gn/T/hsperfdata_rewriter/config.txt)
Steps to Reproduce
Put the jar and config.txt in the same folder Upon launch bot will not find config and ask for token
Expected Result
I expected bot to launch from config
Debug Output
Macos 12.3
Additional Info
No response
Checklist
- [X] I have looked for information about this within the documentation
- [X] I have searched for similar issues on the issues page
- [X] I am running the latest version of the bot:
How do you launch the bot?
Simply open jar in the same folder as config.txt
double clicking? idk if it launches with the correct pwd set. check that. dont have apple devices.
Yes, double-clicking. How do I check pwd set?
pwd > pwd.txt
put this in a .sh file & double click it in the same dir, then check the content of pwd.txt
Ok, I might be dumb, but what are you talking about? I do not have neither .sh, nor pwd.txt All I have on my ps is JMusicBot.jar and config.txt in the same folder
do you speak english?
Well, it's not my native language, but yes, I do. What about it?
you should make the .sh file yourself.
How do I make it? What should it do? Sorry, I've never worked with them
Sorry, I don't know how to help you.
If you open up terminal, navigate to the folder with the jar, and run the jar from there with the java -jar JMusicBot... command (use the exact name of the jar), does it load the config correctly?
Surprisingly, it does load correctly. But it still does not open if I launch it from mac's explorer, like any other file
We might want to update getPath to "force" the working directory at MusicBot's directory, just like what we're doing with Windows, to fix any further issues like these. Though, some way should be introduced for (experienced) users to change/disable this.
Forcing the path to the jar directory would be a breaking change for a lot of people, myself included, who run multiple instances of the bot from separate folders.
Maybe another way to handle this would be to do a test upon startup:
- Test file read & write access in current directory
- If fails, move our internal current path to jar directory and test again
- If fails, exit
(This may also assist in debugging issues like people running on unsupported platforms/hardware/hosts that don't have file access)