Skip to content
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

Install script should respect $XDG_CACHE_HOME env var on linux #757

Closed
gasinvein opened this issue Feb 5, 2021 · 0 comments
Closed

Install script should respect $XDG_CACHE_HOME env var on linux #757

gasinvein opened this issue Feb 5, 2021 · 0 comments

Comments

@gasinvein
Copy link

According to XDG Base Directory specification, programs should look at $XDG_CACHE_HOME environment variable to determine the cache directory, and only if it's not set, fall back to the ~/.cache path.
Currently, the fallback path ~/.cache is hardcoded in install.ts:

esbuild/lib/install.ts

Lines 105 to 110 in c04240a

function getCachePath(name: string): string {
const home = os.homedir();
const common = ['esbuild', 'bin', `${name}@${version}`];
if (process.platform === 'darwin') return path.join(home, 'Library', 'Caches', ...common);
if (process.platform === 'win32') return path.join(home, 'AppData', 'Local', 'Cache', ...common);
return path.join(home, '.cache', ...common);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant