-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: respect DENO_DIR and XDG_* environment variables for fs cache #358
base: main
Are you sure you want to change the base?
Conversation
I plan on also PR-ing to Deno core to support XDG lookup there, where it looks like https://github.com/denoland/deno_cache_dir is used - https://github.com/denoland/deno_cache_dir also provides a TypeScript library. I'll leave this open but maybe we should add |
I prefer the solution in #359, but we would need to wait or update |
denoDir || | ||
(xdgCacheDir ? join(xdgCacheDir, "deno") : join(homeDir, ".deno")), | ||
"deployctl", | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, this gets really ugly really easy, the cache-dir library approach seems a lot more appealing to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do the same thing in the cache library, with nicer formatting. I can extract some of that into a variable to make it more readable ig, but yeah I prefer the using the library.
Closes #357. To resolve the "configDir" (now appropriately renamed to "cacheDir");
$DENO_DIR
is checked, and is the result if present.$XDG_CACHE_HOME
is checked, if present the result becomes$XDG_CACHE_HOME/deno
.$HOME/.deno
if the above two fail.The path resolved from the above three steps is then joined with the
deployctl
subdirectory.