UNPKG

@reliverse/rse

Version:

@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power

30 lines (29 loc) 930 B
import { relinka } from "@reliverse/relinka"; export async function checkVercelDeployment(projectName, githubUsername, githubToken, githubInstance) { relinka("verbose", "Checking for existing deployment..."); if (!githubToken) { relinka( "error", "GitHub token not found in rseory. Please restart the CLI and try again. Notify the @reliverse/rsrseers if the problem persists." ); return false; } if (!githubUsername || githubUsername.trim() === "") { relinka("error", "GitHub username is missing"); return false; } try { const { data: deployments } = await githubInstance.rest.repos.listDeployments({ owner: githubUsername, repo: projectName }); return deployments.length > 0; } catch (error) { relinka( "error", "Failed to check Vercel deployments:", error instanceof Error ? error.message : String(error) ); return false; } }