From 9af671a34728b35c48bff2ba163c371dc5084946 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 10 Dec 2020 22:29:32 -0400 Subject: Render XML to text in an indented form for human readability. --- stdlib/source/program/aedifex/command/install.lux | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'stdlib/source/program/aedifex/command/install.lux') diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux index 327a0c119..d11d96a0c 100644 --- a/stdlib/source/program/aedifex/command/install.lux +++ b/stdlib/source/program/aedifex/command/install.lux @@ -21,6 +21,7 @@ ["." tar] ["." xml]]] [world + [program (#+ Program)] ["." file (#+ Path File)] ["." console (#+ Console)]]] [program @@ -47,21 +48,23 @@ (def: #export failure "Failure: No 'identity' defined for the project.") -(def: #export (do! console system profile) - (-> (Console Promise) (file.System Promise) (Command Any)) +(def: #export (do! program console system profile) + (-> (Program Promise) (Console Promise) (file.System Promise) (Command Any)) (case (get@ #/.identity profile) (#.Some identity) - (do ///action.monad - [package (export.library system (set.to-list (get@ #/.sources profile))) - repository (: (Promise (Try Path)) - (file.make-directories promise.monad system (///local.path system identity))) - #let [artifact-name (format repository (\ system separator) (///artifact.identity identity))] - _ (..save! system (binary.run tar.writer package) - (format artifact-name ///artifact/extension.lux-library)) - pom (\ promise.monad wrap (///pom.write profile)) - _ (..save! system (|> pom (\ xml.codec encode) encoding.to-utf8) - (format artifact-name ///artifact/extension.pom))] - (console.write-line //clean.success console)) + (do promise.monad + [home (\ program home [])] + (do ///action.monad + [package (export.library system (set.to-list (get@ #/.sources profile))) + repository (: (Promise (Try Path)) + (file.make-directories promise.monad system (///local.path system home identity))) + #let [artifact-name (format repository (\ system separator) (///artifact.identity identity))] + _ (..save! system (binary.run tar.writer package) + (format artifact-name ///artifact/extension.lux-library)) + pom (\ promise.monad wrap (///pom.write profile)) + _ (..save! system (|> pom (\ xml.codec encode) encoding.to-utf8) + (format artifact-name ///artifact/extension.pom))] + (console.write-line //clean.success console))) _ (console.write-line ..failure console))) -- cgit v1.2.3