Skip to content

Commit

Permalink
fix: failing filepath comparison on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
noelukwa committed May 13, 2023
1 parent c85e8d6 commit 8f52807
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tempest.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ func (tempest *tempest) LoadFS(files fs.FS) (map[string]*template.Template, erro
})

for _, t := range rawTemps {

// get the layouts
lyts := getLayouts(t, layouts)
lyts = append(lyts, t)
Expand Down Expand Up @@ -213,7 +212,6 @@ func (tempest *tempest) LoadFS(files fs.FS) (map[string]*template.Template, erro
func getIncludes(path string, includes []string) []string {
inc := make([]string, 0)
for _, i := range includes {
// fmt.Printf("i: %s\n", i)
if strings.HasPrefix(path, filepath.Dir(i)) || filepath.Dir(i) == "." {
inc = append(inc, i)
}
Expand All @@ -224,7 +222,7 @@ func getIncludes(path string, includes []string) []string {
func getLayouts(path string, layouts []string) []string {
lay := make([]string, 0)
for _, l := range layouts {
if strings.HasPrefix(path, filepath.Dir(l)) || filepath.Dir(l) == "." {
if strings.HasPrefix(path, filepath.ToSlash(filepath.Dir(l))) || filepath.Dir(l) == "." {
lay = append(lay, l)
}
}
Expand Down

0 comments on commit 8f52807

Please sign in to comment.