aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex.lux
diff options
context:
space:
mode:
authorEduardo Julian2020-12-10 22:29:32 -0400
committerEduardo Julian2020-12-10 22:29:32 -0400
commit9af671a34728b35c48bff2ba163c371dc5084946 (patch)
treeec35f32b8f0cabec702708e0e3cc4462b587c752 /stdlib/source/program/aedifex.lux
parentd747aada2d6df6538d0a88d70169f3757aef50af (diff)
Render XML to text in an indented form for human readability.
Diffstat (limited to 'stdlib/source/program/aedifex.lux')
-rw-r--r--stdlib/source/program/aedifex.lux111
1 files changed, 56 insertions, 55 deletions
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)))))))
))))))