Update SystemKeywords.ts
Some checks are pending
GBCI / build (push) Waiting to run

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2025-08-25 19:33:51 -03:00
parent 2695b54460
commit 864107fca0

View file

@ -1345,6 +1345,7 @@ export class SystemKeywords {
await minioClient.fGetObject(bucketName, fileUrl, localName);
csvFile = localName;
GBLogEx.info(min, `Downloaded .csv: ${csvFile}.`);
}
const data = await fs.readFile(csvFile, 'utf8');
@ -1352,6 +1353,9 @@ export class SystemKeywords {
const firstLine = data.split('\n')[0];
const headers = firstLine.split(',');
const db = await csvdb(csvFile, headers, ',');
GBLogEx.info(min, `READ .csv: ${csvFile}.`);
if (args[0]) {
const systemFilter = await SystemKeywords.getFilter(args[0]);
let filter = {};
@ -1361,6 +1365,8 @@ export class SystemKeywords {
res = await db.get();
}
GBLogEx.info(min, `ROWS: ${res.length}.`);
return res.length > 1 ? res : res[0];
} else {
const t = this.getTableFromName(file, min);