From 8c3a1afab9efeb86e2f53d743551fc689fbad257 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Jun 2022 13:33:48 -0400 Subject: De-sigil-ification: suffix : [Part 4] --- stdlib/source/program/aedifex/repository/local.lux | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'stdlib/source/program/aedifex/repository/local.lux') 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))))) -- cgit v1.2.3