Skip to content

Commit

Permalink
Make sure we only process directories
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed May 21, 2014
1 parent 9587a06 commit b5d2fbf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions stitcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,23 @@ const (
func Stitch(sourceDirectory string, destinationDirectory string) {
files, _ := ioutil.ReadDir(sourceDirectory)
for _, f := range files {
if f.Name() != "WMO" {
compileMinimap(destinationDirectory + f.Name(), sourceDirectory + f.Name(), f.Name(), false)
fd, err := os.Open(sourceDirectory + f.Name())
if err != nil {
fmt.Println(err)
return
}
fi, err := fd.Stat()
if err != nil {
fmt.Println(err)
return
}
mode := fi.Mode()
if mode.IsDir() {
if f.Name() != "WMO" {
compileMinimap(destinationDirectory + f.Name(), sourceDirectory + f.Name(), f.Name(), false)
}
}
fd.Close()
}
}

Expand Down

0 comments on commit b5d2fbf

Please sign in to comment.