aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler/meta/cache/archive.lux
blob: 8a60f6d41a21061cc2692a98842b522dff4a961d (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
(.using
 [library
  [lux (.except)
   [control
    [try (.only Try)]]
   [data
    [text
     ["%" format]]]
   [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)
            (at fs separator)
            "descriptor"))

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