Use / in the name of the asset.

Windows path separator is not / in \.
This commit is contained in:
SATO taichi 2014-02-28 20:33:10 +09:00
parent 1c1928d3b6
commit eb1b26017a

View File

@ -82,6 +82,7 @@ func findFiles(dir, prefix string, recursive bool, toc *[]Asset) error {
if len(prefix) > 0 { if len(prefix) > 0 {
dir, _ = filepath.Abs(dir) dir, _ = filepath.Abs(dir)
prefix, _ = filepath.Abs(prefix) prefix, _ = filepath.Abs(prefix)
prefix = filepath.ToSlash(prefix)
} }
fd, err := os.Open(dir) fd, err := os.Open(dir)
@ -99,7 +100,7 @@ func findFiles(dir, prefix string, recursive bool, toc *[]Asset) error {
for _, file := range list { for _, file := range list {
var asset Asset var asset Asset
asset.Path = filepath.Join(dir, file.Name()) asset.Path = filepath.Join(dir, file.Name())
asset.Name = asset.Path asset.Name = filepath.ToSlash(asset.Path)
if file.IsDir() { if file.IsDir() {
if recursive { if recursive {