@jjdenhertog/ai-driven-development
Version:
AI-driven development workflow with learning capabilities for Claude
29 lines • 1.06 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGitInstance = getGitInstance;
const simple_git_1 = __importDefault(require("simple-git"));
// Cache for git instances by path
const gitInstanceCache = new Map();
/**
* Get or create a git instance for a specific directory
* @param baseDir - The base directory for git operations (defaults to process.cwd())
*/
function getGitInstance(baseDir) {
const path = baseDir || process.cwd();
// Check if we already have an instance for this path
let instance = gitInstanceCache.get(path);
if (!instance) {
// Create new instance and cache it
instance = (0, simple_git_1.default)({
baseDir: path,
binary: 'git',
maxConcurrentProcesses: 6,
});
gitInstanceCache.set(path, instance);
}
return instance;
}
//# sourceMappingURL=getGitInstance.js.map