def called
import ezx@1.11.0.0/src/ez/named.bend as Namedimport Base
import ezx@1.11.0.0/src/ez/target.bend as Tgt
54# the name a source gives itself. A remote is its slug's last component, which
55# is the repository with any `.git` already off; a path is the last component
56# of the directory it was resolved to.
57def called(place: Tgt.Place, +url: String) -> String:
58 match place:
59 case Tgt.Bad{_why}:
60 ""
61 case Tgt.Local{_path}:
62 leaf(url)
63 case Tgt.Remote{_url, slug}:
64 leaf(slug)