aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/repository
diff options
context:
space:
mode:
authorEduardo Julian2021-07-11 01:51:04 -0400
committerEduardo Julian2021-07-11 01:51:04 -0400
commitabe24425ced15fd784ef6c62d6f186af72b491db (patch)
tree42b6e3cbd179c83fae8941fa4b128b13afc766f5 /stdlib/source/program/aedifex/repository
parent4610968193df10af12c91f699fec39aeb3ef703a (diff)
Re-named ":coerce" to ":as" since it technically doesn't do coercions.
Diffstat (limited to 'stdlib/source/program/aedifex/repository')
-rw-r--r--stdlib/source/program/aedifex/repository/local.lux21
1 files changed, 12 insertions, 9 deletions
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index b4ba0e22c..b68425609 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -19,32 +19,35 @@
["#." local]
["#." metadata]]])
-(def: (root /)
- (-> Text file.Path)
- (text.replace_all uri.separator / ///local.repository))
+(def: (root program /)
+ (-> (Program Promise) Text file.Path)
+ (|> ///local.repository
+ (text.replace_all uri.separator /)
+ (format (\ program home) /)))
(def: (path /)
(-> Text (-> URI file.Path))
(text.replace_all uri.separator /))
-(def: (absolute_path /)
- (-> Text (-> URI file.Path))
+(def: (absolute_path program /)
+ (-> (Program Promise) Text (-> URI file.Path))
(|>> ///metadata.local_uri
(..path /)
- (format (..root /) /)))
+ (format (..root program /) /)))
(implementation: #export (repository program fs)
(-> (Program Promise) (file.System Promise) (//.Repository Promise))
(def: description
- (..root (\ fs separator)))
+ (..root program (\ fs separator)))
+
(def: download
- (|>> (..absolute_path (\ fs separator))
+ (|>> (..absolute_path program (\ fs separator))
(\ fs read)))
(def: (upload uri content)
(do {! promise.monad}
- [#let [absolute_path (..absolute_path (\ fs separator) uri)]
+ [#let [absolute_path (..absolute_path program (\ fs separator) uri)]
? (\ fs file? absolute_path)
_ (if ?
(wrap [])