Skip to content

Prefer process.env.XDG_CACHE_HOME on macOS #18

Description

@uncenter

If a user explicitly defines an XDG_CACHE_HOME, it should be used. This is already the case on posix systems:

function posix (id) {
  const cacheHome = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache')
  return path.join(cacheHome, id)
}

It would make sense to do the same on darwin/macOS:

function darwin (id) {
  const cacheHome = process.env.XDG_CACHE_HOME || path.join(os.homedir(), 'Library', 'Caches')
  return path.join(cacheHome, id)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions