Skip to content

Commit

Permalink
doc(api) XDG user dirs are not env vars, fix tauri-apps#3090
Browse files Browse the repository at this point in the history
This commit points the docs on `path.downloadDir` for XDG_DOWNLOAD_DIR
on Linux, and similar XDG user dirs, at the `xdg-user-dirs` program for
more information, and fixes that they currently imply these are
environment variables; which they a) are unfortunately not by any sort
of standard; b) such env vars are ignored by `dirs-next` which tauri
uses for resolving them.

This does not address the issue of
`${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dir` needing to already
exist and contain the appropriate key for this to work (i.e. they do not
default to `$HOME` as the output of `xdg-user-dir` does) - because that
IMO is a shortcoming of `dirs-next` and is better addressed there.
  • Loading branch information
OJFord committed Dec 21, 2021
1 parent a377e18 commit 684f082
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tooling/api/src/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function appDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_MUSIC_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_MUSIC_DIR`.
* - **macOS:** Resolves to `$HOME/Music`.
* - **Windows:** Resolves to `{FOLDERID_Music}`.
*
Expand Down Expand Up @@ -137,7 +137,7 @@ async function dataDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_DESKTOP_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DESKTOP_DIR`.
* - **macOS:** Resolves to `$HOME/Library/Desktop`.
* - **Windows:** Resolves to `{FOLDERID_Desktop}`.
Expand All @@ -159,7 +159,7 @@ async function desktopDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_DOCUMENTS_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOCUMENTS_DIR`.
* - **macOS:** Resolves to `$HOME/Documents`.
* - **Windows:** Resolves to `{FOLDERID_Documents}`.
*
Expand All @@ -181,7 +181,7 @@ async function documentDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux**: Resolves to `$XDG_DOWNLOAD_DIR`.
* - **Linux**: Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_DOWNLOAD_DIR`.
* - **macOS**: Resolves to `$HOME/Downloads`.
* - **Windows**: Resolves to `{FOLDERID_Downloads}`.
*
Expand Down Expand Up @@ -291,7 +291,7 @@ async function localDataDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_PICTURES_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PICTURES_DIR`.
* - **macOS:** Resolves to `$HOME/Pictures`.
* - **Windows:** Resolves to `{FOLDERID_Pictures}`.
*
Expand All @@ -313,7 +313,7 @@ async function pictureDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_PUBLICSHARE_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_PUBLICSHARE_DIR`.
* - **macOS:** Resolves to `$HOME/Public`.
* - **Windows:** Resolves to `{FOLDERID_Public}`.
*
Expand Down Expand Up @@ -373,7 +373,7 @@ async function runtimeDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_TEMPLATES_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_TEMPLATES_DIR`.
* - **macOS:** Not supported.
* - **Windows:** Resolves to `{FOLDERID_Templates}`.
*
Expand All @@ -395,7 +395,7 @@ async function templateDir(): Promise<string> {
*
* #### Platform-specific
*
* - **Linux:** Resolves to `$XDG_VIDEOS_DIR`.
* - **Linux:** Resolves to [`xdg-user-dirs`](https://www.freedesktop.org/wiki/Software/xdg-user-dirs/)' `XDG_VIDEOS_DIR`.
* - **macOS:** Resolves to `$HOME/Movies`.
* - **Windows:** Resolves to `{FOLDERID_Videos}`.
*
Expand Down

0 comments on commit 684f082

Please sign in to comment.