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.lux60
1 files changed, 30 insertions, 30 deletions
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index b76833c34..ada14650b 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -1,24 +1,24 @@
(.using
- [library
- [lux "*"
- [abstract
- [monad {"+" do}]]
- [control
- ["[0]" try]
- [concurrency
- ["[0]" async {"+" Async}]]]
- [data
- ["[0]" text
- ["%" format {"+" format}]]]
- [world
- [program {"+" Program}]
- ["[0]" file]
- [net
- ["[0]" uri {"+" URI}]]]]]
- ["[0]" //
- ["/[1]" // "_"
- ["[1][0]" local]
- ["[1][0]" metadata]]])
+ [library
+ [lux "*"
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" try {"+" Try}]
+ [concurrency
+ ["[0]" async {"+" Async}]]]
+ [data
+ ["[0]" text
+ ["%" format {"+" format}]]]
+ [world
+ [program {"+" Program}]
+ ["[0]" file]
+ [net
+ ["[0]" uri {"+" URI}]]]]]
+ ["[0]" //
+ ["/[1]" // "_"
+ ["[1][0]" local]
+ ["[1][0]" metadata]]])
(def: (root program /)
(-> (Program Async) Text file.Path)
@@ -50,13 +50,13 @@
(do [! async.monad]
[.let [absolute_path (..absolute_path program (# fs separator) uri)]
? (# fs file? absolute_path)
- _ (if ?
- (in [])
- (case (file.parent fs absolute_path)
- {.#Some parent}
- (file.make_directories async.monad fs parent)
-
- _
- (let [! (try.with async.monad)]
- (# ! in []))))]
- (# fs write content 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 []}))))]
+ (# fs write absolute_path content))))