Skip to content

Commit 717edbe

Browse files
committed
fix package sync
1 parent 368daa8 commit 717edbe

File tree

1 file changed

+10
-1
lines changed
  • apps/svelte.dev/scripts/sync-packages

1 file changed

+10
-1
lines changed

apps/svelte.dev/scripts/sync-packages/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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(/^git\+/, '').replace(/\.git$/, '');
126+
let repo_url = raw_repo_url
127+
?.replace(/^git\+/, '')
128+
.replace(/\.git$/, '')
129+
.replace(/ssh:\/\/git@github.com\/(.+)/, (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

0 commit comments

Comments
 (0)