bob icon indicating copy to clipboard operation
bob copied to clipboard

bob erase fails if ~/.bash_login and ~/.bash_profile don't exist

Open yilisharcs opened this issue 3 months ago • 3 comments

Exactly as it says on the tin.

I don't have those files on my system. Creating empty files solves the issue, but the fact that they can be empty can only mean that they aren't necessary for the process.

yilisharcs avatar Sep 15 '25 06:09 yilisharcs

Have you got an error message coming up, like a panic for instance. Or is it a silent failure?

This may be in this code ( like here https://github.com/MordechaiHadad/bob/blob/b29e161b390018303b5c51ee6a1e207baddeeba9/src/handlers/erase_handler.rs#L81 ) or potentially in a library propagation and it's just being passed up the call stack depending on how it's presenting. Any more information would be great

MrDwarf7 avatar Sep 23 '25 15:09 MrDwarf7

These are the errors I get.

Sep 23 14:19:17.405 ERROR Error: RC file not found: .bash_profile
Sep 23 14:19:25.362 ERROR Error: RC file not found: .bash_login

Quits with error if the first doesn't exist; quits with error if the first exists but the second doesn't.

yilisharcs avatar Sep 23 '25 17:09 yilisharcs

Sep 23 14:19:17.405 ERROR Error: RC file not found: .bash_profile

After properly looking into this my initial suspicion is correct, it'll be an out of repo error coming up through the ? operator. ( If you're curious - would be this error. Which is defaulting to POSIX, so sh/bash in this case). If you're desperate to get something working, all it does is use the $SHELL environment variable to route/choose between the different shells. Could hack around it a little by temporary setting the variable on start and reverting it, though not sure how viable that is.

I'll have a look into this in the next couple days and see what I can do via this repo, otherwise may have to submit a PR on the dependency and go from there.

MrDwarf7 avatar Sep 23 '25 21:09 MrDwarf7