blob: b8a728904e5488bcacb45d0756f94dd812f90665 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
(.module:
[lux #*
[abstract
[monad (#+ do)]]
[control
["." try (#+ Try)]
[concurrency
["." promise (#+ Promise) ("#\." monad)]]]
[data
["." text
["%" format (#+ format)]
[encoding
["." utf8]]]
[format
["." xml]]]
[world
["." file (#+ Path File)]
["." console (#+ Console)]]]
["." // #_
["#." clean]
["/#" // #_
[command (#+ Command)]
["#." action (#+ Action)]
["#." pom]]])
(def: #export success
(format "Successfully created POM file: " ///pom.file))
(def: #export (do! console fs profile)
(-> (Console Promise) (file.System Promise) (Command Path))
(do ///action.monad
[pom (promise\wrap (///pom.write profile))
file (: (Promise (Try (File Promise)))
(file.get_file promise.monad fs ///pom.file))
outcome (|> pom
(\ xml.codec encode)
(\ utf8.codec encode)
(\ file over_write))
_ (console.write_line ..success console)]
(wrap ///pom.file)))
|