Files
Orchestrator/privat/CV/andreknie.de/scripts/fix-yaml.js
T
ankn b46de6dc7d
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
ci: migrate GitHub actions to Gitea actions
2026-07-22 15:42:06 +02:00

24 lines
859 B
JavaScript

import fs from 'fs'
import path from 'path'
const files = [
path.join(process.cwd(), 'content', 'consulting', 'ki-experimentierraeume-verwaltung.yaml'),
path.join(process.cwd(), 'content', 'consulting', 'ki-in-der-praxis.yaml'),
path.join(process.cwd(), 'content', 'talks', 'mentor-pwc-scale-2021.yaml'),
path.join(process.cwd(), 'content', 'talks', 'einfachbahn-agiles-arbeiten-2020.yaml')
]
files.forEach(f => {
if (fs.existsSync(f)) {
let raw = fs.readFileSync(f, 'utf8')
// We want to fix the description line which is description: "..."
// Specifically, any " inside the outer " "
raw = raw.replace(/^description: "(.*)"$/gm, (match, p1) => {
// replace " with ' inside p1
return 'description: "' + p1.replace(/"/g, "'") + '"'
})
fs.writeFileSync(f, raw)
console.log('Fixed:', path.basename(f))
}
})