diff options
Diffstat (limited to 'stdlib/source/program/aedifex/repository')
-rw-r--r-- | stdlib/source/program/aedifex/repository/local.lux | 21 |
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 []) |