From 4fbbf30fbdd60acf43a929d1f32a1632251e8671 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 8 Mar 2024 13:14:22 +0000 Subject: [PATCH] Remove old files --- scripts/merge-yaml.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/merge-yaml.js b/scripts/merge-yaml.js index 1404e6b..faca9c6 100644 --- a/scripts/merge-yaml.js +++ b/scripts/merge-yaml.js @@ -37,7 +37,16 @@ function sortAndMergeYAMLFiles() { let outputString = "pis:\n"; mergedData.forEach(item => { outputString += ` - code: "${item.code}"\n`; - outputString += ` stops: [${item.stops.map(stop => `"${stop}"`).join(', ')}]\n`; + outputString += ` stops: [${item.stops.map(stop => `${stop}`).join(',')}]\n`; + }); + + fs.writeFileSync('./pis/gw.yaml', outputString); + + files.forEach(file => { + if (file.startsWith('dg_parser')) { + fs.unlinkSync(directoryPath + file); + console.log(`Deleted file: ${file}`); + } }); console.log(outputString) @@ -46,9 +55,5 @@ function sortAndMergeYAMLFiles() { } } -function yamlWriteInNiceFormat(yaml) { - output = "pis:\n" - -} sortAndMergeYAMLFiles(); \ No newline at end of file