aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/aedifex/command/deploy.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-06 21:34:21 -0400
committerEduardo Julian2021-07-06 21:34:21 -0400
commit2b909032e7a0bd10cd7db52067d2fb701bfa95e5 (patch)
tree0e2aaef228f80f3336715327f7f34065c309de22 /stdlib/source/test/aedifex/command/deploy.lux
parent5cf4efa861075f8276f43a2516f5beacaf610b44 (diff)
Simplified the API for file-system operations.
Diffstat (limited to 'stdlib/source/test/aedifex/command/deploy.lux')
-rw-r--r--stdlib/source/test/aedifex/command/deploy.lux82
1 files changed, 29 insertions, 53 deletions
diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux
index fd4395935..a40d8e394 100644
--- a/stdlib/source/test/aedifex/command/deploy.lux
+++ b/stdlib/source/test/aedifex/command/deploy.lux
@@ -2,17 +2,16 @@
[lux #*
["_" test (#+ Test)]
[abstract
- ["." monad (#+ do)]]
+ [monad (#+ do)]]
[control
- ["." try (#+ Try) ("#\." functor)]
- ["." exception]
+ ["." try (#+ Try)]
[concurrency
["." promise (#+ Promise)]]
[parser
- ["." environment (#+ Environment)]]]
+ ["." environment]]]
[data
["." maybe]
- ["." binary]
+ ["." binary ("#\." equivalence)]
["." text ("#\." equivalence)
["%" format (#+ format)]
[encoding
@@ -22,61 +21,40 @@
["." tar]
["." xml]]
[collection
- ["." set (#+ Set)]
- ["." dictionary (#+ Dictionary)]]]
+ ["." set]]]
[math
- ["." random (#+ Random)]]
+ ["." random]]
[world
- ["." file (#+ Path File)]
+ ["." file]
["." program (#+ Program)]]]
[program
[compositor
["." export]]]
[//
- ["@." version]
+ ["$." install]
+ ["$." version]
[//
- ["@." profile]
- ["@." repository]]]
+ ["$." profile]
+ ["$." repository]]]
{#program
["." /
- ["/#" // #_
- ["#." clean]
- ["/#" // #_
- ["#" profile]
- ["#." action]
- ["#." pom]
- ["#." local]
- ["#." hash]
- ["#." repository (#+ Repository)
- [identity (#+ Identity)]
- ["#/." remote]]
- ["#." artifact (#+ Artifact)
- ["#/." extension]]]]]})
-
-(def: (make_sources! fs sources)
- (-> (file.System Promise) (Set Path) (Promise (Try Any)))
- (loop [sources (set.to_list sources)]
- (case sources
- #.Nil
- (|> []
- (\ try.monad wrap)
- (\ promise.monad wrap))
-
- (#.Cons head tail)
- (do (try.with promise.monad)
- [_ (: (Promise (Try Path))
- (file.make_directories promise.monad fs head))
- _ (: (Promise (Try (File Promise)))
- (file.get_file promise.monad fs (format head (\ fs separator) head ".lux")))]
- (recur tail)))))
+ ["//#" /// #_
+ ["#" profile]
+ ["#." action]
+ ["#." pom]
+ ["#." hash]
+ ["#." repository (#+ Repository)
+ ["#/." remote]]
+ ["#." artifact (#+ Artifact)
+ ["#/." extension]]]]})
(def: (execute! program repository fs artifact profile)
(-> (Program Promise) (Repository Promise) (file.System Promise)
Artifact ///.Profile
(Promise (Try Text)))
(do ///action.monad
- [#let [console (@version.echo "")]
- _ (..make_sources! fs (get@ #///.sources profile))
+ [#let [console ($version.echo "")]
+ _ ($install.make_sources! fs (get@ #///.sources profile))
_ (/.do! console repository fs artifact profile)]
(\ console read_line [])))
@@ -90,12 +68,12 @@
[artifact (get@ #///.identity profile)
expected_pom (try.to_maybe (///pom.write profile))]
(wrap [artifact expected_pom profile])))
- @profile.random)
+ $profile.random)
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [repository (///repository.mock @repository.mock
- @repository.empty)
+ #let [repository (///repository.mock $repository.mock
+ $repository.empty)
fs (file.mock (\ file.default separator))
program (program.async (program.mock environment.empty home working_directory))]]
(wrap (do {! promise.monad}
@@ -124,14 +102,12 @@
(text\= /.success logging)
deployed_library!
- (\ binary.equivalence =
- expected_library
- actual_library)
+ (binary\= expected_library
+ actual_library)
deployed_pom!
- (\ binary.equivalence =
- (|> expected_pom (\ xml.codec encode) (\ utf8.codec encode))
- actual_pom)
+ (binary\= (|> expected_pom (\ xml.codec encode) (\ utf8.codec encode))
+ actual_pom)
deployed_sha-1!
(\ ///hash.equivalence =