diff --git a/src/bin/tools/downloadAndUnzip.ts b/src/bin/tools/downloadAndUnzip.ts index 94317d2b..230e2575 100644 --- a/src/bin/tools/downloadAndUnzip.ts +++ b/src/bin/tools/downloadAndUnzip.ts @@ -72,7 +72,9 @@ async function getNpmProxyConfig(): Promise { const proxyOpts = await getNpmProxyConfig(); - const opts: FetchOptions = { cachePath: join(homedir(), ".keycloakify/cache"), ...proxyOpts }; + const cacheRoot = process.env.XDG_CACHE_HOME ?? homedir(); + const cachePath = join(cacheRoot, ".keycloakify/cache"); + const opts: FetchOptions = { cachePath, ...proxyOpts }; const response = await fetch(url, opts); const filepath = pathJoin(dir, filename); await mkdir(dir, { recursive: true });