make chache dir on Open() if missing

master
Oliver Tonnhofer 2013-05-17 10:28:32 +02:00
parent 9b72f02381
commit f4e9d2c841
1 changed files with 4 additions and 1 deletions

5
cache/db.go vendored
View File

@ -73,7 +73,10 @@ func NewOSMCache(dir string) *OSMCache {
}
func (c *OSMCache) Open() error {
var err error
err := os.MkdirAll(c.Dir, 0755)
if err != nil {
return err
}
c.Coords, err = NewDeltaCoordsCache(filepath.Join(c.Dir, "coords"))
if err != nil {
return err