diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/program/compositor/export.lux | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/stdlib/source/program/compositor/export.lux b/stdlib/source/program/compositor/export.lux index 238034534..24ba3492c 100644 --- a/stdlib/source/program/compositor/export.lux +++ b/stdlib/source/program/compositor/export.lux @@ -38,16 +38,16 @@ {#tar.user commons #tar.group commons})) -(def: #export (library system sources) +(def: #export (library fs sources) (-> (file.System Promise) (List Source) (Promise (Try tar.Tar))) (do (try.with promise.monad) - [files (io.enumerate system sources)] + [files (io.enumerate fs sources)] (|> (dictionary.entries files) (monad.map try.monad (function (_ [path source_code]) (do try.monad [path (|> path - (text.replace_all (\ system separator) .module_separator) + (text.replace_all (\ fs separator) .module_separator) tar.path) source_code (tar.content source_code)] (wrap (#tar.Normal [path @@ -61,13 +61,11 @@ (\ try.monad map row.from_list) (\ promise.monad wrap)))) -(def: #export (export system [sources target]) +(def: #export (export fs [sources target]) (-> (file.System Promise) Export (Promise (Try Any))) - (do (try.with promise.monad) - [tar (..library system sources) - package (: (Promise (Try (file.File Promise))) - (file.get_file promise.monad system - (format target (\ system separator) ..file)))] - (|> tar - (binary.run tar.writer) - (\ package over_write)))) + (do {! (try.with promise.monad)} + [tar (\ ! map (binary.run tar.writer) + (..library fs sources))] + (|> ..file + (format target (\ fs separator)) + (\ fs write tar)))) |