From eea741e9b4a47ae09832311d6d61f0bd6024f673 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 31 Oct 2020 02:59:48 -0400 Subject: Easy to use Rev constants. --- stdlib/source/program/aedifex/artifact.lux | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'stdlib/source/program/aedifex/artifact.lux') 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 -- cgit v1.2.3