File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
apps/svelte.dev/scripts/sync-packages Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,20 @@ async function getNpmAndGitHubData(pkg: string): Promise<PackageKey & PackageNpm
123123
124124 const npm_description = npmInfo . description ;
125125 const raw_repo_url = npmInfo . repository ?. url ?? '' ;
126- const repo_url = raw_repo_url ?. replace ( / ^ g i t \+ / , '' ) . replace ( / \. g i t $ / , '' ) ;
126+ let repo_url = raw_repo_url
127+ ?. replace ( / ^ g i t \+ / , '' )
128+ . replace ( / \. g i t $ / , '' )
129+ . replace ( / s s h : \/ \/ g i t @ g i t h u b .c o m \/ ( .+ ) / , ( m ) => `https://github.com/${ m } ` ) ;
130+
127131 if ( ! repo_url ) {
128132 // console.error(`repo_url not found for ${pkg}`);
129133 logsAtTheEnd . push ( { type : 'no_repo_url' , pkg, extra : `not found` } ) ;
130134 }
135+
136+ if ( repo_url . startsWith ( 'github.com' ) ) {
137+ repo_url = 'https://' + repo_url ;
138+ }
139+
131140 const git_org = repo_url ?. split ( '/' ) [ 3 ] ;
132141 const git_repo = repo_url ?. split ( '/' ) [ 4 ] ;
133142
You can’t perform that action at this time.
0 commit comments