fix: update file-manager to properly handle YAML manifest files

- Added js-yaml import for YAML parsing
- Updated readManifest to parse YAML instead of JSON
- Updated createManifest to write YAML instead of JSON
- Fixes installation error when updating existing BMAD installations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Brian Madison
2025-06-19 12:31:27 -05:00
parent e663a1146b
commit 724cdd07a1

View File

@@ -2,6 +2,7 @@ const fs = require("fs-extra");
const path = require("path"); const path = require("path");
const crypto = require("crypto"); const crypto = require("crypto");
const glob = require("glob"); const glob = require("glob");
const yaml = require("js-yaml");
// Dynamic import for ES module // Dynamic import for ES module
let chalk; let chalk;
@@ -106,7 +107,7 @@ class FileManager {
// Write manifest // Write manifest
await fs.ensureDir(path.dirname(manifestPath)); await fs.ensureDir(path.dirname(manifestPath));
await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2)); await fs.writeFile(manifestPath, yaml.dump(manifest, { indent: 2 }));
return manifest; return manifest;
} }
@@ -120,7 +121,7 @@ class FileManager {
try { try {
const content = await fs.readFile(manifestPath, "utf8"); const content = await fs.readFile(manifestPath, "utf8");
return JSON.parse(content); return yaml.load(content);
} catch (error) { } catch (error) {
return null; return null;
} }