Files
turboci-admin/src/utils/grab-git-repo-name.ts
T
2026-03-14 07:19:46 +01:00

13 lines
297 B
TypeScript

export default function grabGitRepoName({
git_url,
}: {
git_url: string;
}): string | undefined {
const git_arr = git_url.split("/");
const repo_name = git_arr.pop()?.replace(/\.git$/, "");
const repo_user_name = git_arr.pop();
return `${repo_user_name}/${repo_name}`;
}