@jjdenhertog/ai-driven-development
Version:
AI-driven development workflow with learning capabilities for Claude
22 lines • 825 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateTaskFile = updateTaskFile;
const fs_extra_1 = require("fs-extra");
function updateTaskFile(taskPath, metadata) {
// Read existing JSON content
const content = (0, fs_extra_1.readFileSync)(taskPath, 'utf8');
let existingData;
try {
existingData = JSON.parse(content);
}
catch (_err) {
// If file is not valid JSON, start with empty object
existingData = {};
}
// Merge metadata with existing data
const updatedData = Object.assign(Object.assign({}, existingData), metadata);
// Write back as formatted JSON
const jsonContent = JSON.stringify(updatedData, null, 4);
(0, fs_extra_1.writeFileSync)(taskPath, jsonContent);
}
//# sourceMappingURL=updateTaskFile.js.map