From b964ef5f88226cc592c262c7a7c75b60d43c8ef0 Mon Sep 17 00:00:00 2001 From: Gonzalo <456459+grzuy@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:34:10 -0300 Subject: [PATCH] feat: provides blend.clean task that cleans blend _build --- lib/mix/tasks/blend/clean.ex | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/mix/tasks/blend/clean.ex diff --git a/lib/mix/tasks/blend/clean.ex b/lib/mix/tasks/blend/clean.ex new file mode 100644 index 0000000..819d0bc --- /dev/null +++ b/lib/mix/tasks/blend/clean.ex @@ -0,0 +1,22 @@ +defmodule Mix.Tasks.Blend.Clean do + use Mix.Task + + @shortdoc "Cleans blend build artifacts" + @requirements ["app.config"] + + @impl true + def run(args) do + Blend.blends() + |> Map.keys() + |> Enum.map(fn blend_id -> + IO.puts("Cleaning blend #{blend_id}") + + Blend.within( + blend_id, + fn -> + Mix.Task.rerun("clean", ["--deps" | args]) + end + ) + end) + end +end