aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex
diff options
context:
space:
mode:
authorEduardo Julian2021-06-14 18:33:54 -0400
committerEduardo Julian2021-06-14 18:33:54 -0400
commit519c0c0c71cdf7ce3dfc64b9781ab826760b3d94 (patch)
tree75fa0672afceff129e5e75afb7a5fed197ce1773 /stdlib/source/program/aedifex
parentaf3e6e2cb011dc2ad9204440990731a2f272716d (diff)
Extracted Licentia out of the standard library.
Diffstat (limited to 'stdlib/source/program/aedifex')
-rw-r--r--stdlib/source/program/aedifex/artifact/time.lux12
-rw-r--r--stdlib/source/program/aedifex/metadata/snapshot.lux3
-rw-r--r--stdlib/source/program/aedifex/repository/local.lux10
3 files changed, 17 insertions, 8 deletions
diff --git a/stdlib/source/program/aedifex/artifact/time.lux b/stdlib/source/program/aedifex/artifact/time.lux
index 59367c37d..b227c3954 100644
--- a/stdlib/source/program/aedifex/artifact/time.lux
+++ b/stdlib/source/program/aedifex/artifact/time.lux
@@ -5,12 +5,15 @@
[equivalence (#+ Equivalence)]
[monad (#+ do)]]
[control
+ ["." try (#+ Try)]
["<>" parser
["<.>" text (#+ Parser)]]]
[data
["." product]
[text
- ["%" format (#+ Format)]]]]
+ ["%" format (#+ Format)]]]
+ [time
+ ["." instant (#+ Instant)]]]
["." / #_
["#." date]
["#." time]])
@@ -22,6 +25,13 @@
Time
[/date.epoch time.midnight])
+(def: #export (from_instant instant)
+ (-> Instant (Try Time))
+ (do try.monad
+ [date (/date.date (instant.date instant))]
+ (wrap [date
+ (instant.time instant)])))
+
(def: #export equivalence
(Equivalence Time)
(product.equivalence /date.equivalence
diff --git a/stdlib/source/program/aedifex/metadata/snapshot.lux b/stdlib/source/program/aedifex/metadata/snapshot.lux
index f6878a023..c8feaa3d9 100644
--- a/stdlib/source/program/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/program/aedifex/metadata/snapshot.lux
@@ -37,6 +37,7 @@
["/#" // #_
[repository (#+ Repository)]
["#." artifact (#+ Group Name Version Artifact)
+ ["#/." time]
["#/." type (#+ Type)]
["#/." versioning (#+ Versioning)]
["#/." snapshot
@@ -99,7 +100,7 @@
(|>> (case> (^ (list))
(list {#///artifact/snapshot/version.extension ///artifact/type.jvm_library
#///artifact/snapshot/version.value version
- #///artifact/snapshot/version.updated instant.epoch})
+ #///artifact/snapshot/version.updated ///artifact/time.epoch})
versions
versions))))
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index 6b4575627..d026559c9 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -36,13 +36,11 @@
Bit
URI
(Promise (Try (File Promise))))
- (do {! promise.monad}
- [#let [uri (text.replace_once ///metadata.remote_file ///metadata.local_file uri)]
- home (\ program home [])
- #let [/ (\ system separator)
- absolute_path (format home / (..root /) / (..path / uri))]]
+ (let [uri (text.replace_once ///metadata.remote_file ///metadata.local_file uri)
+ / (\ system separator)
+ absolute_path (format (..root /) / (..path / uri))]
(if create?
- (do {! (try.with !)}
+ (do {! (try.with promise.monad)}
[_ (: (Promise (Try Path))
(file.make_directories promise.monad system (file.parent system absolute_path)))]
(: (Promise (Try (File Promise)))