Skip to content

Commit 9c92c3e

Browse files
committed
Use filepath.Join instead of website/docs for windows compatability.
1 parent aeb1105 commit 9c92c3e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/provider/migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (m *migrator) ProviderExamplesDir() string {
381381

382382
func determineWebsiteDir(providerDir string) (string, error) {
383383
// Check for legacy website directory
384-
providerWebsiteDirFileInfo, err := os.Stat(filepath.Join(providerDir, "website/docs"))
384+
providerWebsiteDirFileInfo, err := os.Stat(filepath.Join(providerDir, "website", "docs"))
385385

386386
if err != nil {
387387
if os.IsNotExist(err) {
@@ -390,7 +390,7 @@ func determineWebsiteDir(providerDir string) (string, error) {
390390
return "", fmt.Errorf("error getting information for provider website directory %q: %w", providerDir, err)
391391
}
392392
} else if providerWebsiteDirFileInfo.IsDir() {
393-
return "website/docs", nil
393+
return filepath.Join("website", "docs"), nil
394394
}
395395

396396
// Check for docs directory

internal/provider/validate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func (v *validator) validate(ctx context.Context) error {
172172
result = errors.Join(result, err)
173173

174174
}
175-
if dirExists(v.providerFS, "website/docs") {
175+
if dirExists(v.providerFS, filepath.Join("website", "docs")) {
176176
v.logger.infof("detected legacy website directory, running checks")
177177
err = v.validateLegacyWebsite()
178178
result = errors.Join(result, err)
@@ -263,7 +263,7 @@ func (v *validator) validateStaticDocs() error {
263263
}
264264

265265
func (v *validator) validateLegacyWebsite() error {
266-
dir := "website/docs"
266+
dir := filepath.Join("website", "docs")
267267
var result error
268268

269269
options := &check.ProviderFileOptions{

0 commit comments

Comments
 (0)