aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/artifact
diff options
context:
space:
mode:
authorEduardo Julian2020-10-31 02:59:48 -0400
committerEduardo Julian2020-10-31 02:59:48 -0400
commiteea741e9b4a47ae09832311d6d61f0bd6024f673 (patch)
tree9d503f609c322c235811856ffa05232991b9c653 /stdlib/source/program/aedifex/artifact
parentcb8f2b36352948108446c7e3b270faa97589bf7a (diff)
Easy to use Rev constants.
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/artifact.lux23
1 files changed, 16 insertions, 7 deletions
diff --git a/stdlib/source/program/aedifex/artifact.lux b/stdlib/source/program/aedifex/artifact.lux
index dc0892eb1..c29cc7b2d 100644
--- a/stdlib/source/program/aedifex/artifact.lux
+++ b/stdlib/source/program/aedifex/artifact.lux
@@ -9,8 +9,9 @@
[collection
["." list ("#@." monoid)]]]
[world
+ ["." file (#+ Path)]
[net
- ["." uri]]]])
+ ["." uri (#+ URI)]]]])
(type: #export Group
Text)
@@ -64,20 +65,28 @@
..identity-separator
(..identity value)))
-(def: #export (path artifact)
- (-> Artifact Text)
+(def: (address separator artifact)
+ (-> Text Artifact Text)
(let [directory (%.format (|> artifact
(get@ #group)
(text.split-all-with ..group-separator)
- (text.join-with uri.separator))
- uri.separator
+ (text.join-with separator))
+ separator
(get@ #name artifact)
- uri.separator
+ separator
(get@ #version artifact))]
(%.format directory
- uri.separator
+ separator
(..identity artifact))))
+(def: #export uri
+ (-> Artifact URI)
+ (..address uri.separator))
+
+(def: #export (path system)
+ (All [!] (-> (file.System !) Artifact Path))
+ (..address (:: system separator)))
+
(def: #export (local artifact)
(-> Artifact (List Text))
(list@compose (|> artifact