Skip to content

Commit

Permalink
Use filepath.Join instead of website/docs for windows compatability.
Browse files Browse the repository at this point in the history
  • Loading branch information
SBGoods committed Oct 22, 2024
1 parent aeb1105 commit 9c92c3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/provider/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 9c92c3e

Please # to comment.