Minor Changes

This commit is contained in:
SukkaW 2025-02-28 14:16:36 +08:00
parent 4cb789933e
commit 20e3298c1d

View File

@ -66,33 +66,30 @@ export const downloadPreviousBuild = task(require.main === module, __filename)(a
const pathPrefix = 'ruleset.skk.moe-master/';
const gunzip = zlib.createGunzip();
const extract = tarExtract(
PUBLIC_DIR,
{
ignore(_: string, header?: TarEntryHeaders) {
if (header) {
if (header.type !== 'file' && header.type !== 'directory') {
return true;
}
if (header.type === 'file' && path.extname(header.name) === '.ts') {
return true;
}
}
return false;
},
map(header) {
header.name = header.name.replace(pathPrefix, '');
return header;
}
}
);
return pipeline(
respBody,
gunzip,
extract
zlib.createGunzip(),
tarExtract(
PUBLIC_DIR,
{
ignore(_: string, header?: TarEntryHeaders) {
if (header) {
if (header.type !== 'file' && header.type !== 'directory') {
return true;
}
if (header.type === 'file' && path.extname(header.name) === '.ts') {
return true;
}
}
return false;
},
map(header) {
header.name = header.name.replace(pathPrefix, '');
return header;
}
}
)
);
});
});