What's happening
The --addrepo flag accepts any valid URL, but the suffix-parsing logic inside src/force.ts does a hardcoded split('com/'),
which only works for GitHub-style URLs. Any other host (gitlab.com group paths, .org, .io, self-hosted) can result in undefined,
causing a crash before deletion even runs.
Steps to reproduce
metacall-deploy --addrepo=https://gitlab.com/mygroup/myrepo --force
What you'd expect
Suffix generation works for any valid repo URL.
What actually happens
split('com/')[1] returns undefined and the next .split('/') throws.
The fix
Parse the URL properly using new URL() (already used elsewhere in index.ts) to extract the pathname, strip the leading slash, and replace all remaining slashes with dashes to generate the suffix.
This is host-agnostic and consistent with how the rest of the codebase handles URLs.
Happy to open a PR.
What's happening
The
--addrepoflag accepts any valid URL, but the suffix-parsing logic insidesrc/force.tsdoes a hardcodedsplit('com/'),which only works for GitHub-style URLs. Any other host (
gitlab.comgroup paths,.org,.io, self-hosted) can result inundefined,causing a crash before deletion even runs.
Steps to reproduce
What you'd expect
Suffix generation works for any valid repo URL.
What actually happens
split('com/')[1]returnsundefinedand the next.split('/')throws.The fix
Parse the URL properly using
new URL()(already used elsewhere inindex.ts) to extract the pathname, strip the leading slash, and replace all remaining slashes with dashes to generate the suffix.This is host-agnostic and consistent with how the rest of the codebase handles URLs.
Happy to open a PR.