dirs-dev/directories-rs

Misleading API docs: `xdg-user-dirs` rather than env var

sanmai-NL opened this issue · 3 comments

When debugging an issue detecting the Documents directory from within an Alpine Linux Docker container, I discovered that this library tries to run an executable named xdg-user-dirs. The API docs, however, only say that certain environment variables are queried.

soc commented

Thanks for the report Sander, I agree with you that this has not been documented.

Hopefully the situation will improvement due to #52 in the future.

I will look into resolving this in the next few days.

soc commented

Hi Sander,

I agree with you that the documentation has not been clear in this regard:

In the documentation I used placeholders starting with $... (e. g. $HOME, $XDG_CONFIG_HOME) for environment variables, and placeholders without $ (e. g. XDG_MUSIC_DIR, XDG_DOCUMENT_DIR) for variables retrieved using xdg-user-dirs, but never documented this.

I just shipped version 2.0.0 right now, which does not rely on the mentioned executable anymore.
Instead, the library reads and parses the user-dirs.dirs file directly.

Does this resolve the issue for you? (Are you concerned about the missing documentation, or about running an executable/reading a file?)

Thanks,

Simon

soc commented

Closing this due to age/no reply. Please reopen if this is still an issue!