From 8a2e070cab90993741e7bd47bfc23e12de26d882 Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Thu, 27 Feb 2025 13:06:30 -0800 Subject: [PATCH] Remove yaml2json --- scripts/schema-publish.sh | 7 ++----- scripts/yaml2json/yaml2json.js | 30 ------------------------------ 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100755 scripts/yaml2json/yaml2json.js diff --git a/scripts/schema-publish.sh b/scripts/schema-publish.sh index ccbc0451a6..258fac119d 100755 --- a/scripts/schema-publish.sh +++ b/scripts/schema-publish.sh @@ -32,12 +32,9 @@ publish_schema() { local target=$deploydir/$base/$date mkdir -p $deploydir/$base - # replace the WORK-IN-PROGRESS placeholders - sed -e $sedCmd $schemaDir/$schema > $target.yaml - node scripts/yaml2json/yaml2json.js "$target.yaml" - rm "$target.yaml" - mv "$target.json" "$target" + # replace the WORK-IN-PROGRESS placeholders + sed ${sedCmd[@]} $schemaDir/$schema | npx yaml --json --indent 2 --single > $target # Find the jekyll lander markdown file for this iteration. local jekyllLander=$(find "$deploydir/$base" -maxdepth 1 -name "*.md") diff --git a/scripts/yaml2json/yaml2json.js b/scripts/yaml2json/yaml2json.js deleted file mode 100755 index decb075cc7..0000000000 --- a/scripts/yaml2json/yaml2json.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - -const fs = require('fs'); -const yaml = require('yaml'); - -function convert(filename) { - // console.log(filename); - const s = fs.readFileSync(filename,'utf8'); - let obj; - try { - obj = yaml.parse(s, {prettyErrors: true}); - fs.writeFileSync(filename.replace('.yaml','.json'),JSON.stringify(obj,null,2),'utf8'); - } - catch (ex) { - console.warn(' ',ex.message); - process.exitCode = 1; - } -} - -if (process.argv.length<3) { - console.warn('Usage: yaml2json {infiles}'); -} -else { - for (let i=2;i