From 807397bee04be51d9ca1b5a67ac3635d813eae58 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 14 Apr 2023 10:28:13 +0200 Subject: [PATCH] feat: :sparkles: add craft_and_complete function to create and execute artefacts --- lib/comfpile/core.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/comfpile/core.rb b/lib/comfpile/core.rb index 658c3a1..b0c5d61 100644 --- a/lib/comfpile/core.rb +++ b/lib/comfpile/core.rb @@ -154,5 +154,16 @@ module Comfpile puts "Done after #{step_count} exec loops..." end + def craft_and_complete(stage, target) + artefact = craft_artefact(stage, target) + + return nil if artefact.nil? + + while artefact.in_progress? + execute_step + end + + artefact + end end end \ No newline at end of file