refactor(GBDeployer): simplify file type checks for downloading text files
All checks were successful
GBCI / build (push) Successful in 44s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-05-11 21:21:25 -03:00
parent f078881b0d
commit c5f522d7d7

View file

@ -547,17 +547,13 @@ export class GBDeployer implements IGBDeployer {
} }
} }
if (onlyTextFiles && !obj.name.endsWith('.txt') || !obj.name.endsWith('.json') // Only download text files if onlyTextFiles flag is set
&& !obj.name.endsWith('.csv') && !obj.name.endsWith('.xlsx') && !obj.name.endsWith('.xls') if (onlyTextFiles) {
&& !obj.name.endsWith('.xlsm') && !obj.name.endsWith('.xlsb') && !obj.name.endsWith('.xml') // Check if file is NOT one of the allowed text file types
&& !obj.name.endsWith('.html') && !obj.name.endsWith('.htm') && !obj.name.endsWith('.md') if (!obj.name.match(/\.(txt|json|csv|xlsx?|xlsm|xlsb|xml|html?|md|docx?|pdf|pptx?)$/i)) {
&& !obj.name.endsWith('.docx') && !obj.name.endsWith('.pdf') && !obj.name.endsWith('.txt')
&& !obj.name.endsWith('.doc') && !obj.name.endsWith('.pptx') && !obj.name.endsWith('.ppt')
) {
download = false; download = false;
} }
}
if (download) { if (download) {