Skip to content

Commit

Permalink
fix: incorrect project path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sosolyht committed May 30, 2023
1 parent a347b3b commit 070d5ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sitemap/sitemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sitemap

import (
"encoding/xml"
"fmt"
"io"
"log"
"net/http"
Expand Down Expand Up @@ -87,7 +88,7 @@ func (s *sitemap) Path(path string) *sitemap {
log.Fatal(err)
}

projectRoot := filepath.Join(currentDir, "..", "..")
projectRoot := fmt.Sprintf("%s/%s", filepath.Dir(currentDir), filepath.Base(currentDir))
sitemapsDir := filepath.Join(projectRoot, path)

_, err = os.Stat(sitemapsDir)
Expand Down
3 changes: 2 additions & 1 deletion sitemap/video_sitemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sitemap

import (
"encoding/xml"
"fmt"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -94,7 +95,7 @@ func (v *videoSitemap) Path(path string) *videoSitemap {
log.Fatal(err)
}

projectRoot := filepath.Join(currentDir, "..", "..")
projectRoot := fmt.Sprintf("%s/%s", filepath.Dir(currentDir), filepath.Base(currentDir))
sitemapsDir := filepath.Join(projectRoot, path)

_, err = os.Stat(sitemapsDir)
Expand Down

0 comments on commit 070d5ea

Please sign in to comment.