Comments (6)
Also it looks like XDG_*_DIR env vars do not override the user-dirs.dirs file, checked in firefox/chromium
const (
envDesktopDir = "XDG_DESKTOP_DIR"
envDownloadDir = "XDG_DOWNLOAD_DIR"
envDocumentsDir = "XDG_DOCUMENTS_DIR"
envMusicDir = "XDG_MUSIC_DIR"
envPicturesDir = "XDG_PICTURES_DIR"
envVideosDir = "XDG_VIDEOS_DIR"
envTemplatesDir = "XDG_TEMPLATES_DIR"
envPublicShareDir = "XDG_PUBLICSHARE_DIR"
)
from xdg.
Hi @mateusz834. Thank you for your interest in the library. Reading user-dirs.dirs
is already a task in my to-do list.
I'll start working on this. Hopefully, I can release a new version sometime next week (depending on my free time).
Also it looks like XDG_*_DIR env vars do not override the user-dirs.dirs file, checked in firefox/chromium
Yeah, that seems to be the case. I think the priority to should be:
user-dirs.dirs values
> environment variables
> defaults
from xdg.
It even look like that env vars are completely ignored by firefox/chromium.
I removed the user-dirs.dirs
file and set the XDG_DOWNLOAD_DIR
env var to a different directory and the downloaded file was saved in the default directory.
But for backwards compatibility I think that the order should be:
environment variables
> user-dirs.dirs values
> defaults
Maybe someone is relying on the env vars now and after the change it will suddenly use values from user-dirs.dirs
??
from xdg.
Ideally, there would be no breaking changes. I try to steer clear of them as much as possible. However, in this case, I think the default behavior going forward should be to rely on the values provided by user-dirs.dirs
, then fall back to other sources.
I made a quick search through GitHub and it seems most people are using this package for base directories rather than user directories. I think very few people customize user directory environment variables anyway, especially if they're ignored by other applications. In any case, the change will be documented in the release notes.
Alternatively, I could introduce an option to control whether user-dirs.dirs
has priority. However, I think it clutters the package interface unnecessarily.
from xdg.
Any updates on this? I recently found this library and I guess I'm one of the edge cases that need the parsing of user-dirs.dirs
.
from xdg.
Related Issues (13)
- Support more XDG directories HOT 4
- createPath might be doing to much HOT 3
- Plan 9 support HOT 3
- On windows please use KnownfolderPath HOT 4
- Custom file system support? HOT 4
- `Create` may set up wrong permissions for some directories in the path HOT 8
- Dupplicate `homeDir`'s implementation HOT 2
- macOS: do not use ~/Library/Preferences HOT 3
- DataDirs no longer used HOT 7
- Provide CacheDir function HOT 2
- Remove might be a bit to harsh HOT 3
- Should not change permissions without consent HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdg.