fix: respect DENO_DIR and XDG_* environment variables for fs cache#358
fix: respect DENO_DIR and XDG_* environment variables for fs cache#358uncenter wants to merge 2 commits intodenoland:mainfrom
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.
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.
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_DIRis checked, and is the result if present.$XDG_CACHE_HOMEis checked, if present the result becomes$XDG_CACHE_HOME/deno.$HOME/.denoif the above two fail.The path resolved from the above three steps is then joined with the
deployctlsubdirectory.