From 9441cfa773ff8162d107757f5993c1769809eec2 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 22 Nov 2024 13:47:47 +0100 Subject: [PATCH] Add function to capture output in infra --- src/dda/backup/infrastructure.clj | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dda/backup/infrastructure.clj b/src/dda/backup/infrastructure.clj index 9a92d9c..a0b8b89 100644 --- a/src/dda/backup/infrastructure.clj +++ b/src/dda/backup/infrastructure.clj @@ -12,3 +12,12 @@ (println c)) (when-not dry-run (apply t/shell c))))) + +(defn-spec execute-out! string? + [command ::core/command + config ::core/execution] + (let [{:keys [dry-run debug]} config] + (when debug + (println command)) + (when-not dry-run + (:out (t/shell {:out :string} (clojure.string/join " " command)))))) \ No newline at end of file