Handle zip files that do not list directories

Some zip files do not mark the subdirectories in them as "files"
but they still need to be created.

Fixes #803
This commit is contained in:
Zachary Yedidia
2017-09-07 17:02:26 -04:00
parent 1a575bc9ae
commit 65b5d6c5a9

View File

@@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"sort"
"strings"
@@ -434,6 +435,12 @@ func (pv *PluginVersion) DownloadAndInstall() error {
return err
}
} else {
basepath := path.Dir(targetName)
if err := os.MkdirAll(basepath, dirPerm); err != nil {
return err
}
content, err := f.Open()
if err != nil {
return err