Merge pull request #20 from taichi/use_to_slash

Use / in the name of the asset.
This commit is contained in:
jimt 2014-02-28 19:34:45 +01:00
commit 362b0784bb

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 {