fix: Use OS-aware path joiner

This commit is contained in:
Ilya Kuznetsov 2024-12-17 15:07:22 +01:00
parent 00376711a3
commit 7d8ae48f6b
2 changed files with 4 additions and 11 deletions

View File

@ -5,7 +5,7 @@ import (
"fmt"
"log"
"os"
"path"
"path/filepath"
"reflect"
"github.com/databricks/cli/bundle/config"
@ -129,9 +129,9 @@ func main() {
}
func generateSchema(workdir, outputFile string) {
annotationsPath := path.Join(workdir, "annotations.yml")
annotationsOpenApiPath := path.Join(workdir, "annotations_openapi.yml")
annotationsOpenApiOverridesPath := path.Join(workdir, "annotations_openapi_overrides.yml")
annotationsPath := filepath.Join(workdir, "annotations.yml")
annotationsOpenApiPath := filepath.Join(workdir, "annotations_openapi.yml")
annotationsOpenApiOverridesPath := filepath.Join(workdir, "annotations_openapi_overrides.yml")
// Input file, the databricks openapi spec.
inputFile := os.Getenv("DATABRICKS_OPENAPI_SPEC")

View File

@ -5,7 +5,6 @@ import (
"os"
"path"
"reflect"
"runtime"
"testing"
"github.com/databricks/cli/bundle/config"
@ -41,9 +40,6 @@ func copyFile(src, dst string) error {
// 2. replace all "PLACEHOLDER" values with the actual descriptions if possible
// 3. run `make schema` again to regenerate the schema with acutal descriptions
func TestRequiredAnnotationsForNewFields(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
workdir := t.TempDir()
annotationsPath := path.Join(workdir, "annotations.yml")
annotationsOpenApiPath := path.Join(workdir, "annotations_openapi.yml")
@ -68,9 +64,6 @@ func TestRequiredAnnotationsForNewFields(t *testing.T) {
// Checks whether types in annotation files are still present in Config type
func TestNoDetachedAnnotations(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip()
}
files := []string{
"annotations.yml",
"annotations_openapi.yml",