aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/repository/local.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/program/aedifex/repository/local.lux')
-rw-r--r--stdlib/source/program/aedifex/repository/local.lux40
1 files changed, 20 insertions, 20 deletions
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index 6f031ccfd..6e9db2755 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -38,27 +38,27 @@
(..path /)
(format (..root program fs) /))))
-(implementation: .public (repository program fs)
+(def: .public (repository program fs)
(-> (Program Async) (file.System Async) (//.Repository Async))
+ (implementation
+ (def: description
+ (..root program fs))
- (def: description
- (..root program fs))
+ (def: download
+ (|>> (..absolute_path program fs)
+ (at fs read)))
- (def: download
- (|>> (..absolute_path program fs)
- (at fs read)))
+ (def: (upload uri content)
+ (do [! async.monad]
+ [.let [absolute_path (..absolute_path program fs uri)]
+ ? (at fs file? absolute_path)
+ _ (is (Async (Try Any))
+ (if ?
+ (in {try.#Success []})
+ (case (file.parent fs absolute_path)
+ {.#Some parent}
+ (file.make_directories async.monad fs parent)
- (def: (upload uri content)
- (do [! async.monad]
- [.let [absolute_path (..absolute_path program fs uri)]
- ? (at fs file? absolute_path)
- _ (is (Async (Try Any))
- (if ?
- (in {try.#Success []})
- (case (file.parent fs absolute_path)
- {.#Some parent}
- (file.make_directories async.monad fs parent)
-
- _
- (in {try.#Success []}))))]
- (at fs write absolute_path content))))
+ _
+ (in {try.#Success []}))))]
+ (at fs write absolute_path content)))))