aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/compiler/meta/cache/archive.lux
blob: 0b48b95ddd5071a104f7d9f9e3749e52f95e26fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   [control
    [try (.only Try)]]
   [data
    [text
     ["%" \\format]]]
   [meta
    ["[0]" configuration (.only Configuration)]]
   [world
    ["[0]" file]]]]
 ["[0]" // (.only)
  ["/[1]" // (.only)
   [context (.only Context)]
   ["[0]" archive (.only Archive)]]])

(def .public (descriptor fs context)
  (All (_ !) (-> (file.System !) Context file.Path))
  (%.format (//.path fs context)
            (of fs separator)
            "descriptor"))

(def .public (cache! fs configuration context it)
  (All (_ !) (-> (file.System !) Configuration Context Archive (! (Try Any))))
  (of fs write (..descriptor fs context) (archive.export ///.version configuration it)))