use cacheDirPath for temporary directories

This commit is contained in:
Joseph Garrone
2024-05-17 00:54:54 +02:00
parent f935922241
commit 7d61be231e
6 changed files with 21 additions and 21 deletions

View File

@ -23,8 +23,8 @@ export async function downloadKeycloakStaticResources(params: {
const { themeType, themeDirPath, keycloakVersion, buildOptions } = params;
const tmpDirPath = pathJoin(
themeDirPath,
`tmp_suLeKsxId_${crypto.createHash("sha256").update(`${themeType}-${keycloakVersion}`).digest("hex").slice(0, 8)}`
buildOptions.cacheDirPath,
`downloadKeycloakStaticResources_tmp_${crypto.createHash("sha256").update(`${themeType}-${keycloakVersion}`).digest("hex").slice(0, 8)}`
);
await downloadBuiltinKeycloakTheme({
@ -45,5 +45,5 @@ export async function downloadKeycloakStaticResources(params: {
"destDirPath": pathJoin(resourcesPath, resources_common)
});
rmSync(tmpDirPath, { "recursive": true, "force": true });
rmSync(tmpDirPath, { "recursive": true });
}