mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 09:40:34 +08:00
Minor Changes
This commit is contained in:
parent
4cb789933e
commit
20e3298c1d
@ -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;
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user