MusicBot icon indicating copy to clipboard operation
MusicBot copied to clipboard

[Bug Report] Macos does not see config.txt

Open Rewriter00x opened this issue 3 years ago • 15 comments

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

Rewriter00x avatar Mar 24 '22 07:03 Rewriter00x

How do you launch the bot?

Sanduhr32 avatar Mar 25 '22 19:03 Sanduhr32

Simply open jar in the same folder as config.txt

Rewriter00x avatar Mar 26 '22 11:03 Rewriter00x

double clicking? idk if it launches with the correct pwd set. check that. dont have apple devices.

Sanduhr32 avatar Mar 26 '22 11:03 Sanduhr32

Yes, double-clicking. How do I check pwd set?

Rewriter00x avatar Mar 26 '22 11:03 Rewriter00x

pwd > pwd.txt

put this in a .sh file & double click it in the same dir, then check the content of pwd.txt

Sanduhr32 avatar Mar 26 '22 12:03 Sanduhr32

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

Rewriter00x avatar Mar 26 '22 12:03 Rewriter00x

do you speak english?

Sanduhr32 avatar Mar 26 '22 16:03 Sanduhr32

Well, it's not my native language, but yes, I do. What about it?

Rewriter00x avatar Mar 26 '22 16:03 Rewriter00x

you should make the .sh file yourself.

Sanduhr32 avatar Mar 26 '22 17:03 Sanduhr32

How do I make it? What should it do? Sorry, I've never worked with them

Rewriter00x avatar Mar 26 '22 17:03 Rewriter00x

Sorry, I don't know how to help you.

Sanduhr32 avatar Mar 27 '22 12:03 Sanduhr32

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?

jagrosh avatar Mar 29 '22 16:03 jagrosh

Surprisingly, it does load correctly. But it still does not open if I launch it from mac's explorer, like any other file

Rewriter00x avatar Mar 30 '22 21:03 Rewriter00x

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.

MichailiK avatar Apr 06 '22 07:04 MichailiK

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:

  1. Test file read & write access in current directory
  2. If fails, move our internal current path to jar directory and test again
  3. If fails, exit

(This may also assist in debugging issues like people running on unsupported platforms/hardware/hosts that don't have file access)

jagrosh avatar Apr 06 '22 20:04 jagrosh