CachePath: only create base path

This commit is contained in:
Adrien Delorme 2019-03-19 15:30:01 +01:00
parent a3838ecfad
commit 42107c2b8b
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ var DefaultCacheDir = "packer_cache"
func CachePath(paths ...string) (path string, err error) { func CachePath(paths ...string) (path string, err error) {
defer func() { defer func() {
// create the dir based on return path it it doesn't exist // create the dir based on return path it it doesn't exist
os.MkdirAll(path, os.ModePerm) os.MkdirAll(filepath.Base(path), os.ModePerm)
}() }()
cacheDir := DefaultCacheDir cacheDir := DefaultCacheDir
if cd := os.Getenv("PACKER_CACHE_DIR"); cd != "" { if cd := os.Getenv("PACKER_CACHE_DIR"); cd != "" {