mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-16 11:10:33 +08:00
Fix: properly download previous build
This commit is contained in:
parent
4b04736d77
commit
38475da084
@ -27,9 +27,10 @@ const fileExists = (path) => {
|
|||||||
) && !line.endsWith('/')
|
) && !line.endsWith('/')
|
||||||
) {
|
) {
|
||||||
allFileExists = await fileExists(join(__dirname, '..', line));
|
allFileExists = await fileExists(join(__dirname, '..', line));
|
||||||
|
filesList.push(line);
|
||||||
|
|
||||||
if (!allFileExists) {
|
if (!allFileExists) {
|
||||||
break;
|
console.log(`File not exists: ${line}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,6 +40,8 @@ const fileExists = (path) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('Download previous build.');
|
||||||
|
|
||||||
const extractedPath = join(tmpdir(), `sukka-surge-last-build-extracted-${Date.now()}`);
|
const extractedPath = join(tmpdir(), `sukka-surge-last-build-extracted-${Date.now()}`);
|
||||||
|
|
||||||
const [resp] = await Promise.all([
|
const [resp] = await Promise.all([
|
||||||
@ -51,7 +54,8 @@ const fileExists = (path) => {
|
|||||||
tar.x({
|
tar.x({
|
||||||
cwd: extractedPath,
|
cwd: extractedPath,
|
||||||
filter(p) {
|
filter(p) {
|
||||||
return p.split('/')[1] === 'List';
|
const dir = p.split('/')[1];
|
||||||
|
return dir === 'List' || dir === 'Modules';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user