diff options
author | Eduardo Julian | 2020-10-31 02:59:48 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-10-31 02:59:48 -0400 |
commit | eea741e9b4a47ae09832311d6d61f0bd6024f673 (patch) | |
tree | 9d503f609c322c235811856ffa05232991b9c653 /stdlib/source/program/aedifex/artifact | |
parent | cb8f2b36352948108446c7e3b270faa97589bf7a (diff) |
Easy to use Rev constants.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/aedifex/artifact.lux | 23 |
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 |