fix(download): fix download cache not behaving as expected

This commit is contained in:
Waldemar Reusch
2023-03-21 14:48:16 +01:00
committed by GitHub
parent 77da00c2c5
commit 253825a35e

View File

@ -74,7 +74,7 @@ async function download(url: string, dir: string, filename: string): Promise<str
const proxyOpts = await getNpmProxyConfig(); const proxyOpts = await getNpmProxyConfig();
const cacheRoot = process.env.XDG_CACHE_HOME ?? homedir(); const cacheRoot = process.env.XDG_CACHE_HOME ?? homedir();
const cachePath = join(cacheRoot, ".keycloakify/cache"); const cachePath = join(cacheRoot, ".keycloakify/cache");
const opts: FetchOptions = { cachePath, ...proxyOpts }; const opts: FetchOptions = { cachePath, cache: 'force-cache', ...proxyOpts };
const response = await fetch(url, opts); const response = await fetch(url, opts);
const filepath = pathJoin(dir, filename); const filepath = pathJoin(dir, filename);
await mkdir(dir, { recursive: true }); await mkdir(dir, { recursive: true });