Skip to content

Commit

Permalink
Refresh target data holders for every mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrojas87 committed Nov 23, 2023
1 parent e238d65 commit e2b57e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/rml/rml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ async function executeMappings(
}

let out = "";
if(targets) {
// Initialize data holders of every declared target
targets.forEach(t => t.data = "");
}

for (let mappingFile of mappingLocations) {
const t0 = new Date();
console.log("[rmlMapper processor]", "Running", mappingFile);
Expand All @@ -317,9 +322,6 @@ async function executeMappings(

if (targets) {
for (let target of targets) {
if (!target.data) {
target.data = "";
}
target.data += await readFile(target.newLocation, { encoding: "utf8" });
}
} else {
Expand Down

0 comments on commit e2b57e2

Please sign in to comment.