aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/compiler/meta/cache/archive.lux
blob: fa6f273b39fb0310513eb80b85a2fa84ed527245 (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
30
31
32
33
... 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)
  (All (_ !)
    (-> (file.System !)
        file.Path))
  (let [/ (of fs separator)]
    (%.format //.path
              / "descriptor")))

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