cli/internal/bnp/pack.go
Alex Dunmow ab21eb4e88 Build codeless artifacts through the pluginsdk packer
The codeless build, declarative validation and tar.zst packer moved to
block/pluginsdk/bnp (v0.3.10). ninja plugin build and publish call
sdkbnp.BuildCodeless; the wasm build keeps DESCRIBE extraction and uses
the SDK helpers over os.DirFS. weareblissful and the wasm fixture build
to the same sha256 as before. ADR 0003.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 23:31:10 +08:00

21 lines
462 B
Go

package bnp
import (
"fmt"
"io/fs"
"os"
sdkbnp "git.dev.alexdunmow.com/block/pluginsdk/bnp"
)
// packArtifact writes entries as a .bnp to outPath, reading Source entries
// from fsys.
func packArtifact(outPath string, fsys fs.FS, entries []sdkbnp.Entry) (int64, error) {
out, err := os.Create(outPath)
if err != nil {
return 0, fmt.Errorf("create %s: %w", outPath, err)
}
defer func() { _ = out.Close() }()
return sdkbnp.Pack(out, fsys, entries)
}