File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import { AppRuntime } from "@/effect/app-runtime"
3333import { Git } from "@/git"
3434import { setTimeout as sleep } from "node:timers/promises"
3535import { Process } from "@/util"
36- import { parseGitHubRemote } from "@/util/github-remote "
36+ import { parseGitHubRemote } from "@/util/repository "
3737import { Effect } from "effect"
3838
3939type GitHubAuthor = {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -88,6 +88,15 @@ export function parseRepositoryReference(input: string) {
8888 }
8989}
9090
91+ export function parseGitHubRemote ( input : string ) {
92+ const cleaned = normalize ( input )
93+ if ( ! cleaned . includes ( "://" ) && ! cleaned . match ( / ^ (?: [ ^ @ / \s ] + @ ) ? g i t h u b \. c o m : / ) ) return null
94+
95+ const parsed = parseRepositoryReference ( cleaned )
96+ if ( ! parsed || parsed . host !== "github.com" || ! parsed . owner || parsed . segments . length !== 2 ) return null
97+ return { owner : parsed . owner , repo : parsed . repo }
98+ }
99+
91100export function repositoryCachePath ( input : Reference ) {
92101 return path . join ( Global . Path . repos , ...input . host . split ( ":" ) , ...input . segments )
93102}
You can’t perform that action at this time.
0 commit comments