Skip to content

Commit

Permalink
Use ~/Library/Caches as default cache location on OSX - fixes #1637
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian McKenzie committed Nov 3, 2016
1 parent 8de54b1 commit 944746f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,16 @@ function getDirectory(type: string): string {
return path.join(userHome, `.yarn-${type}`);
}

function getCacheDirectory(): string {
if (process.platform === 'darwin') {
return path.join(userHome, 'Library', 'Caches', 'Yarn');
}

return getDirectory('cache');
}

export const GLOBAL_INSTALL_DIRECTORY = path.join(userHome, '.yarn');
export const MODULE_CACHE_DIRECTORY = getDirectory('cache');
export const MODULE_CACHE_DIRECTORY = getCacheDirectory();
export const LINK_REGISTRY_DIRECTORY = getDirectory('config/link');
export const GLOBAL_MODULE_DIRECTORY = getDirectory('config/global');
export const CACHE_FILENAME = path.join(GLOBAL_INSTALL_DIRECTORY, '.roadrunner.json');
Expand Down

0 comments on commit 944746f

Please sign in to comment.