UNPKG

@jjdenhertog/ai-driven-development

Version:

AI-driven development workflow with learning capabilities for Claude

43 lines 1.9 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWorktrees = getWorktrees; const getGitInstance_1 = require("./getGitInstance"); function getWorktrees() { return __awaiter(this, void 0, void 0, function* () { const git = (0, getGitInstance_1.getGitInstance)(); try { const output = yield git.raw(['worktree', 'list', '--porcelain']); const worktrees = []; const lines = output.split('\n'); let currentWorktree = {}; for (const line of lines) { if (line.startsWith('worktree ')) { if (currentWorktree.path) { worktrees.push(currentWorktree); } currentWorktree = { path: line.slice(9) }; } else if (line.startsWith('branch ')) { currentWorktree.branch = line.slice(7); } } if (currentWorktree.path) { worktrees.push(currentWorktree); } return worktrees; } catch (_a) { return []; } }); } //# sourceMappingURL=getWorktrees.js.map