diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-06 01:04:06 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-06 01:04:06 +0900 |
| commit | 86ad8b72aa19f348f5e1a48c79c30accc86fcaa1 (patch) | |
| tree | 2b5f3aa07ba680615b99a66d8e98dc7378435875 | |
| parent | e91049c3c5a81bc18fb5394de92a6d7617421938 (diff) | |
internal/pkg: expose cure through cure context
This allows a curing Artifact to cure Artifact it depends on.
Signed-off-by: Ophestra <cat@gensokyo.uk>
| -rw-r--r-- | internal/pkg/pkg.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go index e1055aca..85a9f823 100644 --- a/internal/pkg/pkg.go +++ b/internal/pkg/pkg.go @@ -78,6 +78,15 @@ func (c *CureContext) GetWorkDir() *check.Absolute { return c.work } // create it if they wish to use it, using [os.MkdirAll]. func (c *CureContext) GetTempDir() *check.Absolute { return c.temp } +// Cure cures the [Artifact] and returns its pathname and [Checksum]. +func (c *CureContext) Cure(a Artifact) ( + pathname *check.Absolute, + checksum Checksum, + err error, +) { + return c.cache.Cure(a) +} + // LoadData tries to load [File] from [Cache], and if that fails, obtains it via // [File.Data] instead. Notably, it does not cure [File]. func (c *CureContext) LoadData(f File) (data []byte, err error) { |
