Startup failure when $XDG_CONFIG_HOME is unset and ~/.config doesn't exist #112

Closed
opened 2019-12-04 02:26:23 +00:00 by jboverf · 4 comments
Collaborator

On an OpenBSD system, the $XDG_CONFIG_HOME variable is not set (I believe this is the case on NetBSD as well), and the ~/.config directory does not exist by default. In this case, bombadillo silently fails.

I'd send a PR but there are multiple ways you could fix this so I didn't want to pick one. You could:

  • Ensure ~/.config exists by using os.MkdirAll first
  • Check if ~/.config exists and if it doesn't, just put .bombadillo.ini in the home directory. I suspect this would be harder code-wise because you'd have to check that location on startup in case the file was put there

There are probably other options I haven't thought of. Anyway if I mkdir ~/.config everything works.

On an OpenBSD system, the $XDG_CONFIG_HOME variable is not set (I believe this is the case on NetBSD as well), and the ~/.config directory does not exist by default. In this case, bombadillo silently fails. I'd send a PR but there are multiple ways you could fix this so I didn't want to pick one. You could: * Ensure ~/.config exists by using os.MkdirAll first * Check if ~/.config exists and if it doesn't, just put .bombadillo.ini in the home directory. I suspect this would be harder code-wise because you'd have to check that location on startup in case the file was put there There are probably other options I haven't thought of. Anyway if I `mkdir ~/.config` everything works.
sloum added the
bug
urgent
labels 2019-12-04 02:51:35 +00:00
Owner

Thanks for this @jboverf ! I'm going to mark this one urgent and it will get into the next release (which I am guessing may be sooner than later).

I think the good way to go will be to have the function that sets the XDG_CONFIG_HOME as the dir check for empty and then check for that folder existing and build it if not. Using the home dir does make it more complicated.

Glad you got it worked out locally and thanks again for the BSD usage report! I have not gotten to test on any BSD so I am glad to hear it runs, even if there was a hiccup.

Thanks for this @jboverf ! I'm going to mark this one urgent and it will get into the next release (which I am guessing may be sooner than later). I think the good way to go will be to have the function that sets the XDG_CONFIG_HOME as the dir check for empty and then check for that folder existing and build it if not. Using the home dir does make it more complicated. Glad you got it worked out locally and thanks again for the BSD usage report! I have not gotten to test on any BSD so I am glad to hear it runs, even if there was a hiccup.
sloum added this to the 2.1.0 milestone 2019-12-04 02:53:03 +00:00
Owner

I have made the adjustments and they seem to be working well on my machine. I hope you don't mind @jboverf I assigned you as a reviewer on the pr. If you dont have time or interest just let me know and I'll ask asdf or merge in without a second set of eyes. If you do have time and willingness, I would greatly appreciate your thoughts!

The pr is #113

I have made the adjustments and they seem to be working well on my machine. I hope you don't mind @jboverf I assigned you as a reviewer on the pr. If you dont have time or interest just let me know and I'll ask asdf or merge in without a second set of eyes. If you do have time and willingness, I would greatly appreciate your thoughts! The pr is #113
sloum self-assigned this 2019-12-04 03:29:11 +00:00
Collaborator

Hey @jboverf sorry you had this issue, but thanks for picking it up and raising it here!

Hey @jboverf sorry you had this issue, but thanks for picking it up and raising it here!
Owner

Closed by #113

Closed by #113
sloum closed this issue 2019-12-06 03:23:37 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sloum/bombadillo#112
No description provided.