Skip to content

Commit 41f8dfb

Browse files
authored
dev: keep only JSONSchema (#6564)
1 parent 81e8f81 commit 41f8dfb

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

  • scripts/website/copy_jsonschema

scripts/website/copy_jsonschema/main.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"log"
77
"os"
88
"path/filepath"
9+
"strings"
910

1011
hcversion "github.com/hashicorp/go-version"
1112

@@ -32,6 +33,22 @@ func copySchemas() error {
3233
return fmt.Errorf("copy FS: %w", err)
3334
}
3435

36+
matches, err := filepath.Glob(filepath.Join(dstDir, "*"))
37+
if err != nil {
38+
return fmt.Errorf("glob: %w", err)
39+
}
40+
41+
for _, match := range matches {
42+
if strings.HasSuffix(match, ".json") {
43+
continue
44+
}
45+
46+
err = os.RemoveAll(match)
47+
if err != nil {
48+
log.Printf("removing %q: %v", match, err)
49+
}
50+
}
51+
3552
err = copyLatestSchema(dstDir)
3653
if err != nil {
3754
return fmt.Errorf("copy files: %w", err)

0 commit comments

Comments
 (0)