From 38475da0847bbd775941a412e9842278814932f3 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sat, 19 Aug 2023 00:02:34 +0800 Subject: [PATCH] Fix: properly download previous build --- Build/download-previous-build.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Build/download-previous-build.js b/Build/download-previous-build.js index 09d918c8..362fd6fd 100644 --- a/Build/download-previous-build.js +++ b/Build/download-previous-build.js @@ -27,9 +27,10 @@ const fileExists = (path) => { ) && !line.endsWith('/') ) { allFileExists = await fileExists(join(__dirname, '..', line)); + filesList.push(line); if (!allFileExists) { - break; + console.log(`File not exists: ${line}`); } } } @@ -39,6 +40,8 @@ const fileExists = (path) => { return; } + console.log('Download previous build.'); + const extractedPath = join(tmpdir(), `sukka-surge-last-build-extracted-${Date.now()}`); const [resp] = await Promise.all([ @@ -51,7 +54,8 @@ const fileExists = (path) => { tar.x({ cwd: extractedPath, filter(p) { - return p.split('/')[1] === 'List'; + const dir = p.split('/')[1]; + return dir === 'List' || dir === 'Modules'; } }) );