def remote

near-v-framework@0.4.0.0 · domain/architecture/system/effects.bend:127

import near-v-framework@0.4.0.0/domain/architecture/system/effects.bend as Effects
import Base
import near-v-framework@0.4.0.0/domain/architecture/system/effs/io.bend as X
import near-v-framework@0.4.0.0/domain/architecture/system/release/type.bend as Rl
import near-v-framework@0.4.0.0/domain/architecture/system/plan/type.bend as P

127def remote(+root: String, r: Rl.Repository) -> IO(P.Remote):
128  match r:
129    case Rl.Repository{+name, _}:
130      do IO<P.Remote>:
131        origin : String <- X.run("git", ["-C", root, "remote", "get-url", "origin"])
132        vis : String <- X.run("gh", ["repo", "view", name, "--json", "visibility", "--jq", ".visibility"])
133        status : String <- X.run("git", ["-C", root, "status", "--porcelain"])
134        head : String <- X.run("git", ["-C", root, "ls-remote", "origin", "refs/heads/main"])
135        up : Bool <- pushed(root, first_word(head))
136        return P.Remote{String.trim(origin), String.to_lower(String.trim(vis)), String.is_empty(String.trim(status)), up}

Uses (14)

Used by (1)