UNPKG

git-veil

Version:

A CLI tool for synchronizing development activities to a personal GitHub repository discreetly and confidentially.

32 lines (31 loc) 1.85 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.executeSyncFlow = void 0; const activityExtractor_1 = require("./activityExtractor"); const mirrorRepo_1 = require("./mirrorRepo"); const commitGenerator_1 = require("./commitGenerator"); function executeSyncFlow(email, targetRepo) { return __awaiter(this, void 0, void 0, function* () { // Step 1: Extract activity related to the specified email const activityExtractor = new activityExtractor_1.ActivityExtractor(email); const activities = yield activityExtractor.extractActivity(); // Step 2: Prepare the mirror repository const mirrorRepo = new mirrorRepo_1.MirrorRepo(targetRepo, { email }); yield mirrorRepo.initialize(); // Step 3: Generate discrete commits based on the extracted activities const commitGenerator = new commitGenerator_1.CommitGenerator(activities); const commits = commitGenerator.generateCommits(); // Step 4: Push the generated commits to GitHub yield mirrorRepo.pushCommits(commits); }); } exports.executeSyncFlow = executeSyncFlow;