def classify.hub
import ezx@1.11.0.0/src/ez/target.bend as Targetimport Base
347# `owner/repo`. Its slug is safe without the check a URL's gets: neither
348# segment is empty, `.`, `..` or holds a slash, so it cannot climb out of the
349# cache. A trailing `.git` is not part of the cache directory, as for a URL.
350def classify.hub(ok: Bool, +text: String) -> Place:
351 match ok:
352 case True{}:
353 Remote{"https://github.com/" ++ text, "github.com/" ++ ungit(text)}
354 case False{}:
355 classify.scp(String.starts_with(text, "git@"), text)