blob: c0e7ecd16e897ac57e7b4c47b5a19a069b77daf3 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
... 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)]
[concurrency
["[0]" async (.only Async)]]]
[data
[binary (.only Binary)]
[text
["%" \\format (.only format)]]]
[meta
[compiler
[target (.only Target)]]]
[world
["[0]" file]]]]
["[0]" //
["[1][0]" module]
[//
["[0]" context (.only Context)]
[archive
["[0]" module]
["[0]" artifact]]]])
(def .public (path fs context @module @artifact)
(All (_ !)
(-> (file.System !) Context module.ID artifact.ID
file.Path))
(let [/ (of fs separator)]
(format (//module.path fs @module)
/ (%.nat @artifact)
(the context.#artifact_extension context))))
(def .public (cache fs context @module @artifact)
(All (_ !)
(-> (file.System !) Context module.ID artifact.ID
(! (Try Binary))))
(of fs read (..path fs context @module @artifact)))
(def .public (cache! fs context @module @artifact content)
(All (_ !)
(-> (file.System !) Context module.ID artifact.ID Binary
(! (Try Any))))
(of fs write (..path fs context @module @artifact) content))
|