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.lux | 111 +++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 55 deletions(-) (limited to 'stdlib/source/program/aedifex.lux') diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux index aac616597..41d7f9b2f 100644 --- a/stdlib/source/program/aedifex.lux +++ b/stdlib/source/program/aedifex.lux @@ -65,14 +65,14 @@ set.to-list (list\map (|>> /repository.remote /repository.async)))) -(def: (with-dependencies console command profile) +(def: (with-dependencies program console command profile) (All [a] - (-> (Console Promise) + (-> (Program Promise) (Console Promise) (-> (Console Promise) (Program Promise) (file.System Promise) (Shell Promise) Resolution (Command a)) (Command a))) (do /action.monad - [resolution (/command/deps.do! console (file.async file.default) (..repositories profile) profile)] - ((command console (program.async program.default) (file.async file.default) (shell.async shell.default) resolution) profile))) + [resolution (/command/deps.do! program console (file.async file.default) (..repositories profile) profile)] + ((command console program (file.async file.default) (shell.async shell.default) resolution) profile))) (exception: (cannot-find-repository {repository Text} {options (Dictionary Text Address)}) @@ -118,61 +118,62 @@ (\ program.default exit shell.error)) (#try.Success profile) - (case operation - #/cli.Version - (wrap []) - - #/cli.Clean - (..command - (/command/clean.do! console (file.async file.default) profile)) + (let [program (program.async program.default)] + (case operation + #/cli.Version + (wrap []) + + #/cli.Clean + (..command + (/command/clean.do! console (file.async file.default) profile)) - #/cli.POM - (..command - (/command/pom.do! console (file.async file.default) profile)) - - #/cli.Install - (..command - (/command/install.do! console (file.async file.default) profile)) + #/cli.POM + (..command + (/command/pom.do! console (file.async file.default) profile)) + + #/cli.Install + (..command + (/command/install.do! program console (file.async file.default) profile)) - (#/cli.Deploy repository identity) - (..command - (case [(get@ #/.identity profile) - (dictionary.get repository (get@ #/.deploy-repositories profile))] - [(#.Some artifact) (#.Some repository)] - (/command/deploy.do! console - (/repository.async (/repository.remote repository)) - (file.async file.default) - identity - artifact - profile) + (#/cli.Deploy repository identity) + (..command + (case [(get@ #/.identity profile) + (dictionary.get repository (get@ #/.deploy-repositories profile))] + [(#.Some artifact) (#.Some repository)] + (/command/deploy.do! console + (/repository.async (/repository.remote repository)) + (file.async file.default) + identity + artifact + profile) - [#.None _] - (promise\wrap (exception.throw /.no-identity [])) + [#.None _] + (promise\wrap (exception.throw /.no-identity [])) - [_ #.None] - (promise\wrap (exception.throw ..cannot-find-repository [repository (get@ #/.deploy-repositories profile)])))) - - #/cli.Dependencies - (..command - (/command/deps.do! console (file.async file.default) (..repositories profile) profile)) + [_ #.None] + (promise\wrap (exception.throw ..cannot-find-repository [repository (get@ #/.deploy-repositories profile)])))) + + #/cli.Dependencies + (..command + (/command/deps.do! program console (file.async file.default) (..repositories profile) profile)) - (#/cli.Compilation compilation) - (case compilation - #/cli.Build (..command - (..with-dependencies console /command/build.do! profile)) - #/cli.Test (..command - (..with-dependencies console /command/test.do! profile))) + (#/cli.Compilation compilation) + (case compilation + #/cli.Build (..command + (..with-dependencies program console /command/build.do! profile)) + #/cli.Test (..command + (..with-dependencies program console /command/test.do! profile))) - (#/cli.Auto auto) - (do ! - [?watcher watch.default] - (case ?watcher - (#try.Failure error) - (wrap (log! error)) - - (#try.Success watcher) - (..command - (case auto - #/cli.Build (..with-dependencies console (/command/auto.do! watcher /command/build.do!) profile) - #/cli.Test (..with-dependencies console (/command/auto.do! watcher /command/test.do!) profile)))))) + (#/cli.Auto auto) + (do ! + [?watcher watch.default] + (case ?watcher + (#try.Failure error) + (wrap (log! error)) + + (#try.Success watcher) + (..command + (case auto + #/cli.Build (..with-dependencies program console (/command/auto.do! watcher /command/build.do!) profile) + #/cli.Test (..with-dependencies program console (/command/auto.do! watcher /command/test.do!) profile))))))) )))))) -- cgit v1.2.3