refactor: convert template.yml files to template.toml format

- Updated the script to convert 'template.yml' files to 'template.toml' files during directory processing.
- Added new 'template.toml' files for Backrest and BlinkO blueprints with appropriate configuration settings.
This commit is contained in:
Mauricio Siu
2025-03-30 04:04:27 -06:00
parent 38e8d9e66a
commit ec644490be
3 changed files with 37 additions and 2 deletions

View File

@@ -22,11 +22,15 @@ function processDirectory(dirPath) {
if (stat.isDirectory()) {
processDirectory(filePath);
} else if (file === "template.yml") {
console.log(`Deleting ${filePath}`);
fs.unlinkSync(filePath);
console.log(`Converting ${filePath}`);
const yamlContent = fs.readFileSync(filePath, "utf8");
const tomlContent = convertYamlToToml(yamlContent);
const tomlPath = path.join(dirPath, "template.toml");
fs.writeFileSync(tomlPath, tomlContent);
}
});
}
// Ruta al directorio blueprints relativa al script
const blueprintsPath = path.join(__dirname, "..", "blueprints");
processDirectory(blueprintsPath);