Effects.tag_state: def of near-v-framework@0.4.0.0
Import: import near-v-framework@0.4.0.0/domain/architecture/system/effects.bend as Effects
Lines 221-230 of near-v-framework@0.4.0.0/domain/architecture/system/effects.bend: https://jend.leeeet.dev/read.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/effects.bend&start_line=221&end_line=230
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
def tag_state(+home: String, +root: String, g: Rl.Plugin) -> IO(P.Tag):
match g:
case Rl.Plugin{+n, +v, +e, _, Rl.Repository{+r, _}}:
do IO
:
built : String <- build_plugin(root, home ++ "/.bend/bin/bend", n, e)
+repo : Bool <- X.succeeds("gh", ["repo", "view", r, "--json", "name"])
tags : String <- X.run("git", ["ls-remote", "--tags", "https://github.com/" ++ r, "refs/tags/" ++ tag_of(n, v)])
+tagged : Bool = repo && Bool.not(String.is_empty(String.trim(tags)))
differs : Bool <- tag_differs(tagged, root, n, v, r)
return P.Tag{repo, tagged, built, differs}
Uses (19):
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty
https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.trim
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/effects.bend&name=build_plugin
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/effects.bend&name=tag_differs
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/effects.bend&name=tag_of
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/effs/io.bend&name=run
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/effs/io.bend&name=succeeds
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/plan/type.bend&name=Tag
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/release/type.bend&name=Plugin
https://jend.leeeet.dev/definition.txt?path=near-v-framework@0.4.0.0/domain/architecture/system/release/type.bend&name=Repository