From 1f97da4eb9442f05ad86c627f883252a35804b07 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Mon, 31 Jan 2022 17:06:00 -0800 Subject: [PATCH] Fix nested vendoring For code embedding (e.g. deploy.sh), we've changed vendor embedding to include all contents instead of just CUE files #1526. The problem is we're vendoring the package's `cue.mod/pkg`. This fixes it. Signed-off-by: Andrea Luzzardi --- pkg/pkg.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/pkg.go b/pkg/pkg.go index a5ee0170..c3dd27b4 100644 --- a/pkg/pkg.go +++ b/pkg/pkg.go @@ -122,6 +122,11 @@ func extractModules(dest string) error { return nil } + // Do not vendor the package's `cue.mod/pkg` + if strings.Contains(p, "cue.mod/pkg") { + return nil + } + contents, err := fs.ReadFile(FS, p) if err != nil { return fmt.Errorf("%s: %w", p, err)