UNPKG

@jjdenhertog/ai-driven-development

Version:

AI-driven development workflow with learning capabilities for Claude

21 lines 993 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addToGitignore = addToGitignore; const node_fs_1 = require("node:fs"); const node_path_1 = require("node:path"); const logger_1 = require("../logger"); function addToGitignore(cwd, value) { const gitignorePath = (0, node_path_1.join)(cwd, '.gitignore'); if ((0, node_fs_1.existsSync)(gitignorePath)) { const gitignoreContent = (0, node_fs_1.readFileSync)(gitignorePath, 'utf8'); if (!gitignoreContent.includes(value)) { (0, node_fs_1.appendFileSync)(gitignorePath, `\n# AIdev worktree (local data storage)\n${value}/\n`); (0, logger_1.log)(`Added ${value} to .gitignore`, 'success'); } } else { (0, node_fs_1.writeFileSync)(gitignorePath, `\n# AIdev worktree (local data storage)\n${value}/\n`); (0, logger_1.log)(`Created .gitignore file and added ${value} to it`, 'success'); } } //# sourceMappingURL=addToGitignore.js.map