UNPKG

review-copilot

Version:

ReviewCopilot - AI-powered code review assistant with customizable prompts

24 lines (23 loc) 1.03 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GitPlatformFactory = void 0; const github_service_1 = require("./github-service"); const gitlab_service_1 = require("./gitlab-service"); const local_git_service_1 = require("./local-git-service"); const environment_helpers_1 = __importDefault(require("../utils/environment-helpers")); class GitPlatformFactory { static createService() { if (environment_helpers_1.default.isGitHubActions) { return new github_service_1.GitHubService(process.env.GITHUB_TOKEN); } if (environment_helpers_1.default.isGitLabCI) { return new gitlab_service_1.GitLabService(process.env.GITLAB_TOKEN); } // For local development, use LocalGitService return new local_git_service_1.LocalGitService(); } } exports.GitPlatformFactory = GitPlatformFactory;