fix window's slash
Showing
1 changed file
with
2 additions
and
1 deletions
| ... | @@ -140,9 +140,10 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error { | ... | @@ -140,9 +140,10 @@ func (self *templatefile) visit(paths string, f os.FileInfo, err error) error { |
| 140 | } | 140 | } |
| 141 | } | 141 | } |
| 142 | if hasExt { | 142 | if hasExt { |
| 143 | replace := strings.NewReplacer("\\", "/") | ||
| 143 | a := []byte(paths) | 144 | a := []byte(paths) |
| 144 | a = a[len([]byte(self.root)):] | 145 | a = a[len([]byte(self.root)):] |
| 145 | subdir := path.Dir(strings.TrimLeft(string(a), "/")) | 146 | subdir := path.Dir(replace.Replace(strings.TrimLeft(string(a), "/"))) |
| 146 | if _, ok := self.files[subdir]; ok { | 147 | if _, ok := self.files[subdir]; ok { |
| 147 | self.files[subdir] = append(self.files[subdir], paths) | 148 | self.files[subdir] = append(self.files[subdir], paths) |
| 148 | } else { | 149 | } else { | ... | ... |
-
Please register or sign in to post a comment