Current section
Files
Jump to
Current section
Files
src/examples@git_clone.erl
-module(examples@git_clone).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/examples/git_clone.gleam").
-export([main/0]).
-file("src/examples/git_clone.gleam", 16).
-spec main() -> nil.
main() ->
dagger:connect(
fun(Client) ->
Repo = begin
_pipe = dagger@dsl@dag:git(
<<"https://github.com/gleam-lang/gleam.git"/utf8>>,
fun dagger@dsl@dag:none/1
),
_pipe@1 = dagger@dsl@git:tag(_pipe, <<"v1.14.0"/utf8>>),
dagger@dsl@git:tree(_pipe@1, fun dagger@dsl@git:none/1)
end,
dagger@dsl@directory:entries(
Repo,
fun dagger@dsl@directory:none/1,
Client,
fun(Result) -> case Result of
{ok, Entries} ->
gleam_stdlib:println(
<<"Repository root contents:"/utf8>>
),
_pipe@2 = Entries,
_pipe@3 = gleam@string:join(_pipe@2, <<"\n"/utf8>>),
gleam_stdlib:println(_pipe@3);
{error, E} ->
gleam_stdlib:println_error(
<<"Pipeline failed: "/utf8,
(gleam@string:inspect(E))/binary>>
)
end end
)
end
).