def url.of
import ezx@1.11.0.0/src/add/world.bend as Worldimport Base
import ezx@1.11.0.0/src/ez/target.bend as Tgt
145# the source a place records: a URL as it is, a path as it was given with a
146# leading `~/` expanded against HOME, and nothing for a target that names
147# nothing
148def url.of(place: Tgt.Place, +home: String) -> String:
149 match place:
150 case Tgt.Bad{_why}:
151 ""
152 case Tgt.Local{path}:
153 Tgt.expand(home, path)
154 case Tgt.Remote{url, _slug}:
155 url