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