diff --git a/internal/provider/migrate.go b/internal/provider/migrate.go index babe2127..3ae1af11 100644 --- a/internal/provider/migrate.go +++ b/internal/provider/migrate.go @@ -381,7 +381,7 @@ func (m *migrator) ProviderExamplesDir() string { func determineWebsiteDir(providerDir string) (string, error) { // Check for legacy website directory - providerWebsiteDirFileInfo, err := os.Stat(filepath.Join(providerDir, "website/docs")) + providerWebsiteDirFileInfo, err := os.Stat(filepath.Join(providerDir, "website", "docs")) if err != nil { if os.IsNotExist(err) { @@ -390,7 +390,7 @@ func determineWebsiteDir(providerDir string) (string, error) { return "", fmt.Errorf("error getting information for provider website directory %q: %w", providerDir, err) } } else if providerWebsiteDirFileInfo.IsDir() { - return "website/docs", nil + return filepath.Join("website", "docs"), nil } // Check for docs directory diff --git a/internal/provider/validate.go b/internal/provider/validate.go index 9500354f..9448d53b 100644 --- a/internal/provider/validate.go +++ b/internal/provider/validate.go @@ -172,7 +172,7 @@ func (v *validator) validate(ctx context.Context) error { result = errors.Join(result, err) } - if dirExists(v.providerFS, "website/docs") { + if dirExists(v.providerFS, filepath.Join("website", "docs")) { v.logger.infof("detected legacy website directory, running checks") err = v.validateLegacyWebsite() result = errors.Join(result, err) @@ -263,7 +263,7 @@ func (v *validator) validateStaticDocs() error { } func (v *validator) validateLegacyWebsite() error { - dir := "website/docs" + dir := filepath.Join("website", "docs") var result error options := &check.ProviderFileOptions{