3c4dd99f by astaxie

fix window's slash

1 parent b6df895d
...@@ -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 {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!