minor refactor
This commit is contained in:
parent
839ba6a964
commit
6d4a948dd8
@ -30,19 +30,23 @@ export async function downloadAndUnzip(params: {
|
|||||||
}) {
|
}) {
|
||||||
const { url, destDirPath, specificDirsToExtract, preCacheTransform, buildOptions } = params;
|
const { url, destDirPath, specificDirsToExtract, preCacheTransform, buildOptions } = params;
|
||||||
|
|
||||||
const zipFileBasename = generateFileNameFromURL({
|
const { extractDirPath, zipFilePath } = (() => {
|
||||||
url,
|
const zipFileBasenameWithoutExt = generateFileNameFromURL({
|
||||||
"preCacheTransform":
|
url,
|
||||||
preCacheTransform === undefined
|
"preCacheTransform":
|
||||||
? undefined
|
preCacheTransform === undefined
|
||||||
: {
|
? undefined
|
||||||
"actionCacheId": preCacheTransform.actionCacheId,
|
: {
|
||||||
"actionFootprint": preCacheTransform.action.toString()
|
"actionCacheId": preCacheTransform.actionCacheId,
|
||||||
}
|
"actionFootprint": preCacheTransform.action.toString()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const zipFilePath = pathJoin(buildOptions.cacheDirPath, `${zipFileBasename}.zip`);
|
const zipFilePath = pathJoin(buildOptions.cacheDirPath, `${zipFileBasenameWithoutExt}.zip`);
|
||||||
const extractDirPath = pathJoin(buildOptions.cacheDirPath, `tmp_unzip_${zipFileBasename}`);
|
const extractDirPath = pathJoin(buildOptions.cacheDirPath, `tmp_unzip_${zipFileBasenameWithoutExt}`);
|
||||||
|
|
||||||
|
return { zipFilePath, extractDirPath };
|
||||||
|
})();
|
||||||
|
|
||||||
download_zip_and_transform: {
|
download_zip_and_transform: {
|
||||||
if (await existsAsync(zipFilePath)) {
|
if (await existsAsync(zipFilePath)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user